update 索取号,题名,著者,出版信息,附注项 from Book没有这种SQL语句,修改的话update Book set 题名='',著者='',出版信息='',附注项='' where 索取号=''
cmd=new SqlCommand("update Book set索取号='"+this.txtNumber.Text+"',题名='"+this.txttitle.Text+"',著者='"+this.txtwriter.Text+"',出版信息='"+this.txtpressinf.Text+"',附注项='"+this.txtappendix.Text+"' where 索取号='"+this.txtNumber.Text+"'",ctl.con); 修改成这样,还是不行啊
真牛~
修改成这样,还是不行啊
set 索取号
你的索引号是字符串类型的吗
你是不是应该改成where 索引号="+this.txtNumber.Text+"
用上面的语句不行,用下面的也不行啊?
DataTable dt=ds.Tables["Book"];
this.listView1.Clear();
foreach(DataRow brow in dt.Rows)
{
if(brow.RowState==DataRowState.Added||brow.RowState==DataRowState.Deleted||brow.RowState==DataRowState.Modified)
{
this.listView1.Items.Add(brow["索取号"].ToString());
this.listView1.Items.Add(brow["题名"].ToString());
this.listView1.Items.Add(brow["著者"].ToString());
this.listView1.Items.Add(brow["出版信息"].ToString());
this.listView1.Items.Add(brow["附注项"].ToString()); } }
高手,应该怎么做到呢?