本文介绍了Int32的值太大或太小......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
string insertquery = INSERT INTO regtab VALUES(' + txtname.Text + ',' + txtemail.Text + ',' + txtpassword.Text + ',' + txtaddress.Text + ', + Convert.ToInt32(txtcontact.Text)+ )跨度>;
CreateConnection();
SqlCommand cmd = new SqlCommand(insertquery,con);
con.Open();
int i = cmd.ExecuteNonQuery();
con.Close();
if (i > 0 )
{
lblmsg.Text = 成功创建员工档案 ;
}
这是数据库值:
id (int)
名称(varchar50)
电子邮件(varchar50)
密码(varchar50)
地址(varchar50 )
联系人(bigint)
解决方案
string insertquery = "INSERT INTO regtab VALUES('" + txtname.Text + "','" + txtemail.Text + "','" + txtpassword.Text +"','" + txtaddress.Text + "'," + Convert.ToInt32(txtcontact.Text) + ")"; CreateConnection(); SqlCommand cmd = new SqlCommand(insertquery, con); con.Open(); int i =cmd.ExecuteNonQuery(); con.Close(); if (i > 0) { lblmsg.Text = "Create Employee Profile Successfully"; }
This is database Values:
id(int)
name(varchar50)
email(varchar50)
password(varchar50)
address(varchar50)
contact(bigint)
解决方案
这篇关于Int32的值太大或太小......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!