This code is error
Private void GetData()
{
using (SPWeb ospWeb = SPContext.Current.Web)
{
//code here
}
}
{
using (SPWeb ospWeb = SPContext.Current.Web)
{
//code here
}
}
Replace code here
Private void GetData()
{
using(SPSite spSite=new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
//code here
}
}
}
{
using(SPSite spSite=new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
//code here
}
}
}
Thanks Dear,
ReplyDeleteYour Code is very helpfull.i am biggner in sharepoint.Can you give me your mailid.
Gopal chauhan
gopal.chanhan@gmail.com