未处理的类型' System.StackOverflowException'发生在System.Data.dll中

时间:2014-04-30 09:56:10

标签: c# gridview datatable ado.net

我收到此错误。比如“在sda.fill(ds) private void txtSearch02() { DataTable dt = new DataTable(); SqlConnection con = new SqlConnection(myStr); SqlCommand cmd = new SqlCommand("select ItemCode,ItemName,PointsNeeded from tb_ItemRedemption where (ItemCode is null or ItemCode='" + txtkey2.Text.Trim() + "') or (ItemName is null or ItemName='" + txtkey2.Text.Trim() + "')", con); con.Open(); cmd.ExecuteNonQuery(); SqlDataAdapter sda = new SqlDataAdapter(cmd); //Session["ItemCode"] = dt; DataSet ds = new DataSet(); sda.Fill(ds); dt = ds.Tables[0]; sda.Dispose(); //con.Close(); // Adding two columns dt.Columns.Add("Quantity"); dt.Columns.Add("TotalPoints"); //Caliculation txtPointsNeeded.Text = dt.Rows[0]["PointsNeeded"].ToString(); foreach (DataRow drdt in dt.Rows) { txtTotalPoints.Text = ""; drdt["Quantity"]=txtQuantity.Text; drdt["TotalPoints"]=txtTotalPoints.Text; } //Caliculation txtGetQuantity.Text = txtQuantity.Text; GridView1.DataSource = dt; GridView1.DataBind(); GridView1.Visible = true; } 的System.Data.dll中发生类型'System.StackOverflowException'的未处理异常请帮助我..

{{1}}

0 个答案:

没有答案