我收到此错误。比如“在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}}