J
Jason M
I wont be able to post all the code because it is in a very large project.
What I'm doing is I create a datagrid with a mixt of bound columns and custum
columns filled with link buttons. Basically I'm using the linkbuttons to
create a master/detail page. When the link button is click in the datagrid
another datagrid is created and filled with data from a stored procedure.
This works untill I start working with a very dataset that has about 10,000
rows. If user half that data no problems. Any ideas how to work around this.
here is a snippet of where the code for the when the LinkButton is clicked
in the datagrid but I'm thinking this isn't the problem.
protected void
HG2_ItemCommand(objectsource,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string s =e.CommandArgument.ToString();
string x=e.CommandArgument[1].ToString();
string myConnString2 = "Password=xx;User ID=xx;Initial
Catalog=DashBoard;Data Source=(local)";
Label lblTitle = new Label();
lblTitle.ID ="lblTitle";
PCP.Controls.Add(new LiteralControl("<BR>"));
PCP.Controls.Add(new LiteralControl("<BR>"));
PCP.Controls.Add(lblTitle);
PCP.Controls.Add(new LiteralControl("<BR>"));
lblTitle.Text = e.CommandName;
lblTitle.ForeColor = System.Drawing.Color.MediumSeaGreen;
lblTitle.Font.Size = 14;
lblTitle.Font.Bold = true;
SqlConnection conn2 = new SqlConnection(myConnString2);
conn2.ConnectionString = myConnString2;
conn2.Open();
SqlCommand cmd2 = conn2.CreateCommand();
cmd2.CommandText = "[detail]";
cmd2.CommandType = System.Data.CommandType.StoredProcedure;
cmd2.Connection = conn2;
DataSet ds2 = new DataSet();
SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
da2.Fill(ds2);
ds2.Tables[0].TableName ="detail";
DataGrid DG1 = new DataGrid();
DG1.ID = "DG1";
PCP1.Controls.Add(new LiteralControl("<BR>"));
PCP1.Controls.Add(DG1);
DG1.GridLines = GridLines.Both;
DG1.CellPadding =1;
DG1.ForeColor=System.Drawing.Color.Black;
DG1.Font.Size = System.Web.UI.WebControls.FontUnit.Smaller;
DG1.BackColor = System.Drawing.Color.WhiteSmoke;
DG1.HeaderStyle.BackColor = System.Drawing.Color.LightSteelBlue;
DG1.DataSource=ds2;
DG1.DataMember ="detail";
DG1.DataBind();
}
What I'm doing is I create a datagrid with a mixt of bound columns and custum
columns filled with link buttons. Basically I'm using the linkbuttons to
create a master/detail page. When the link button is click in the datagrid
another datagrid is created and filled with data from a stored procedure.
This works untill I start working with a very dataset that has about 10,000
rows. If user half that data no problems. Any ideas how to work around this.
here is a snippet of where the code for the when the LinkButton is clicked
in the datagrid but I'm thinking this isn't the problem.
protected void
HG2_ItemCommand(objectsource,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string s =e.CommandArgument.ToString();
string x=e.CommandArgument[1].ToString();
string myConnString2 = "Password=xx;User ID=xx;Initial
Catalog=DashBoard;Data Source=(local)";
Label lblTitle = new Label();
lblTitle.ID ="lblTitle";
PCP.Controls.Add(new LiteralControl("<BR>"));
PCP.Controls.Add(new LiteralControl("<BR>"));
PCP.Controls.Add(lblTitle);
PCP.Controls.Add(new LiteralControl("<BR>"));
lblTitle.Text = e.CommandName;
lblTitle.ForeColor = System.Drawing.Color.MediumSeaGreen;
lblTitle.Font.Size = 14;
lblTitle.Font.Bold = true;
SqlConnection conn2 = new SqlConnection(myConnString2);
conn2.ConnectionString = myConnString2;
conn2.Open();
SqlCommand cmd2 = conn2.CreateCommand();
cmd2.CommandText = "[detail]";
cmd2.CommandType = System.Data.CommandType.StoredProcedure;
cmd2.Connection = conn2;
DataSet ds2 = new DataSet();
SqlDataAdapter da2 = new SqlDataAdapter(cmd2);
da2.Fill(ds2);
ds2.Tables[0].TableName ="detail";
DataGrid DG1 = new DataGrid();
DG1.ID = "DG1";
PCP1.Controls.Add(new LiteralControl("<BR>"));
PCP1.Controls.Add(DG1);
DG1.GridLines = GridLines.Both;
DG1.CellPadding =1;
DG1.ForeColor=System.Drawing.Color.Black;
DG1.Font.Size = System.Web.UI.WebControls.FontUnit.Smaller;
DG1.BackColor = System.Drawing.Color.WhiteSmoke;
DG1.HeaderStyle.BackColor = System.Drawing.Color.LightSteelBlue;
DG1.DataSource=ds2;
DG1.DataMember ="detail";
DG1.DataBind();
}