人家添加了变量啊,指定了变量的数据类型和长度 this.DeleteCommand= new System.Data.SqlClient.SqlCommand(); this.DeleteCommand.CommandText = "delete from s where sno=@sno"; string snoString="001"; this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sno", System.Data.SqlDbType.NVarChar, 50, snoString));
this.DeleteCommand= new System.Data.SqlClient.SqlCommand();
this.DeleteCommand.CommandText = "delete from s where sno=@sno";
string snoString="001";
this.DeleteCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sno", System.Data.SqlDbType.NVarChar, 50, snoString));