Set the Item to static as shown below.
private static MyData DAL { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
return;
DAL = new MyData();
grid1.DataSource = DAL.Customers;
grid1.DataBind();
}
No comments:
Post a Comment
Comments are welcome, but are moderated and may take a wee while before shown.