Click here to Skip to main content
15,888,816 members

Comments by Member 10471582 (Top 1 by date)

Member 10471582 30-Dec-13 23:54pm View    
i have large database, using gridview control to display the all data from sql database, using c#.net and asp.net. but it produce system.out of memory exception. i give the code is
//code:
SqlConnection sqlcon = new SqlConnection("connection string");
sqlcon.Open();
SqlCommand sqlcmd = new SqlCommand("select * from table", sqlcon);
//sqlcmd.ExecuteNonQuery();
SqlDataAdapter sqlda = new SqlDataAdapter(sqlcmd);
DataSet ds = new DataSet();
sqlda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();

how to resolve this ?..........