[英]i want to convert from int64 to byte
無法將參數值從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;
這行:
com.Parameters.Add("@name", SqlDbType.TinyInt).Value = this.phone;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.