the System.OutOfMemoryException error
sir I select data from database(microsoft sql server 2008) and showing in gridview.but execution time,,..error is creating the System.OutOfMemoryException error.plese help me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Puneet GuptaPosted Sep 25, 2013, 2:23 AM
-Xms512M -Xmx1524M
to the VM Arguments section
-----------------------------
I hope this will solve your problem
Jignesh TrivediPosted Sep 25, 2013, 2:09 AM
Generally, this error due to there is no enough memory to continuos the process.
Please refer
http://support.microsoft.com/kb/820108
http://support.microsoft.com/kb/2020006
it might help you to resolve the issue.
venkata kumarPosted Sep 25, 2013, 2:07 AM
try the fallowing
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter da = new SqlDataAdapter("Select * from savedata", Scon);
DataTable dt=new DataTable();
dt.Rows.clear();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
} }
mohit guptaPosted Sep 25, 2013, 1:26 AM
using System.Collections;
using System.Configuration;
using System.Data; using System.Linq;
using System.Web; using System.Web.Security;
using System.Web.UI; using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace EDS
{
public partial class practice : System.Web.UI.Page
{
String strcon = ConfigurationManager.ConnectionStrings["con"].ToString();
SqlConnection Scon;
protected void Page_Load(object sender, EventArgs e)
{
Scon = new SqlConnection(strcon);
Scon.Open();
SqlCommand cmd = new SqlCommand("Select * from savedata", Scon);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
Scon.Close();
if (ds.Tables[0].Rows.Count > 0)
{
GridView1.DataSource = ds;
GridView1.DataBind();
} } } }
Jignesh TrivediPosted Sep 25, 2013, 1:24 AM
can you please share your code,? so that we can help you.
Thx.
Kiran Kumar TalikotiPosted Sep 25, 2013, 12:53 AM
paste the code of selection Event.So that we can help..