输入字符串的格式不正确。确保方法参数的格式正确
SqlCommand cmd = new SqlCommand("Update dbo.guestInfo set Reply = '"+ this.txtContent.Text+"' where ID = "+ int.Parse(ID) +"", conn);说我输入的字符串格式不正确,请帮忙啊 --------------------编程问答-------------------- int.Parse(ID) ==> ID --------------------编程问答-------------------- SqlCommand cmd = new SqlCommand("Update dbo.guestInfo set Reply = '"+ this.txtContent.Text+"' where ID = "+ ID.ToString() +"", conn);
ID是什么类型的?
--------------------编程问答-------------------- ID是 int类型的 --------------------编程问答-------------------- 不对啊会提示新的问题啊 --------------------编程问答--------------------
--------------------编程问答--------------------
SqlCommand cmd = new SqlCommand("Update dbo.guestInfo set Reply = '"+ this.txtContent.Text+"' where ID = '"+ int.Parse(ID) +"'", conn);
--------------------编程问答--------------------
string sql="Update dbo.guestInfo set Reply ='"+ this.txtContent.Text+"' where ID = "+ ID.tostring()
用ID.ToString()
SqlCommand cmd = new SqlCommand("Update dbo.guestInfo set Reply = '"+ this.txtContent.Text+"' where ID = "+ ID.ToString() +"", conn);
补充:.NET技术 , C#