DbCommand dbcomAdd = mydb.GetSqlStringCommand("insert into e_phone(id,e164,password)values(@id,@e164,@password)");
mydb.AddInParameter(dbcomAdd, "@id", DbType.Int32, TextBox1.Text.Trim());
mydb.AddInParameter(dbcomAdd, "@e164", DbType.String, TextBox2.Text.Trim());
mydb.AddInParameter(dbcomAdd, "@password", DbType.String, TextBox3.Text.Trim());
mydb.ExecuteNonQuery(dbcomAdd);是不是我SQL语句有问题,运行后提示ID列不能为空值,可是这样写确没问题DbCommand dbcomAdd = mydb.GetSqlStringCommand("insert into e_phone(id,e164,password)values('"+TextBox1.Text.Trim()+"','11111111','asdqwe')");
解决方案 »
- 获取计算机名?
- asp.net gridview如何传值?另一个页面如何获取?
- sqldatasource能不能不绑定控件直接执行selectcommand?
- 各位高手大哥,请问像CSDN这种大型的网站,论坛存储用户发表的文章是存储在哪里的?
- 请问各种IsolationLevel的意思和用法. 如IsolationLevel.ReadCommitted?
- UpdataCommmand语句问题
- 请问:那种购物网站中的,将商品一排一排地排列起来是怎么做的?是放在表单里的?
- ~~~能否给一个C#模拟登录discuz论坛的例子...~~~
- 数据库连接的关闭
- 一个关于弹出式窗体的新问题! 请各位帮忙。 分数不够可以加! 在线等待
- 同一条sql语句在两个数据库执行一个正常一个超时怎么回事?
- 关于支付宝支付数据写入数据库问题
values 和前面的括号间加空格
DbCommand dbcomAdd = mydb.GetSqlStringCommand("insert into e_phone(id,e164,password) values('"+TextBox1.Text.Trim()+"','11111111','asdqwe')");