无法将参数值从int32转换为字节 数据库代码
,数据库中的程序是:
背后的webform代码:
client c = new client();
c.name = Textbox_Addclient_first.Text + " " + Textbox_Addclient_second.Text +
" " + Textbox_Addclient_third.Text;
c.address = Textbox_addclientadress.Text;
c.phone = int.Parse(Textbox_addclientphone.Text);
班级代码是:
SqlCommand com = new SqlCommand("add_client", con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.Add("@name", SqlDbType.NVarChar).Value = this.name;
com.Parameters.Add("@address", SqlDbType.NVarChar).Value = this.address;
com.Parameters.Add("@name", SqlDbType.TinyInt).Value = this.phone;
com.ExecuteNonQuery();
con.Close();
b = true;
答案 0 :(得分:0)
这一行:
com.Parameters.Add("@name", SqlDbType.TinyInt).Value = this.phone;