如何使用asp.net將電話號碼插入表中?在表中插入電話號碼
string insertquery =
"insert customer (
id, name, address, gender, DOB, contactno, email, userid, password)
values
(@custid, @custname, @custaddress, @gender, @custdob,
@custcno, @custemail, @custuserid, @custpassword)";
這裏custcno是電話號碼。
sc.Parameters.AddWithValue("@custcno",Convert.ToInt32(txtcustcno.Text));
在運行時出現錯誤輸入字符串的格式不正確。
表contactno爲varchar(50)
如果號碼不與計算,這是不是一個數字。電話號碼是字符串。 –