[英]i want to convert from int64 to byte
failed to convert parameter value from int32 to a byte the database code 无法将参数值从int32转换为数据库代码的字节
and the procedure in database is: 数据库中的过程是:
The webform code behind: 后面的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);
The class code is: 类代码为:
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;
This line: 这行:
com.Parameters.Add("@name", SqlDbType.TinyInt).Value = this.phone;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.