0
在更新數據,我得到以下異常:SQL異常,同時更新數據
動態SQL生成的更新命令沒有針對不返回任何鍵列信息的SelectCommand支持。
誰能幫助我嗎?
string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
cn = new SqlConnection(cs);
da = new SqlDataAdapter("select*from Clinic_info", cn);
SqlCommandBuilder cmd = new SqlCommandBuilder(da);
ds = new DataSet();
da.Fill(ds, "Clinic_info");
//ds.Tables["Clinic_info"].Constraints.Add("CL_ID_pk", ds.Tables["Clinic_info"].Columns["CL_ID"], true);
try
{
DataRow row;
row = ds.Tables["Clinic_info"].Rows.Find(Session["msg"].ToString());
row.BeginEdit();
row["CL_Name"] = cl_name.Text;
row["CL_Desc"] = cl_descri.Text;