Thank you Sergey for your attention
this is my code :
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Components.Data.baseLnqDataContext db = new Components.Data.baseLnqDataContext(DotNetNuke.Common.Utilities.Config.GetConnectionString());
var rows = from row in db.Orders select row;
GridView1.DataSource = rows;
GridView1.DataBind();
ViewState["gData"] = rows;
}
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.DataSource = (IQueryable<Components.Data.Orders>)ViewState["gData"];
GridView1.DataBind();
}
I would like to draw your attention to that code is worked on localhost, but when I create a package I installed on a remote site I got this Error :
Error serializing value 'SELECT [t0].[ID], [t0].[Name], [t0].[EngName], [t0].[Address], [t0].[City], [t0].[cState], [t0].[zipcode], [t0].[Phone], [t0].[EmailAddress], [t0].[OrderNo], [t0].[OrderType], [t0].[OrderState], [t0].[OrderDate] FROM [dbo].[CompanyName_Orders] AS [t0] ' of type 'System.Data.Linq.DataQuery`1[[CompanyName.ServicesAdmin.Components.Data.Orders, CompanyName.ServicesAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].'
Thanks