小白 求解!
asp.net吧
全部回复
仅看楼主
level 11
liujianhua290 楼主
int iCustomerId = GetMaxCustomerId();
SqlCommand cmd = _conn.CreateCommand();
cmd.CommandText = string.Format("update Customers set CustomerName='updated CustomerName',
Address = 'updated Address',Phone = "updated Phone" where CustomerId ={0}",iCustomerId);
运行的时候总是提示
2013年07月15日 08点07分 1
level 7
string.Format("update Customers set CustomerName='updated CustomerName',Address = 'updated Address',Phone = "+updatedPhone+" where CustomerId ={0}",iCustomerId);
你换行的时候要用加号。
2013年07月15日 13点07分 2
level 7
string.Format( 去掉,什么都用这个。你Y的胡用函数
2013年07月16日 01点07分 3
那我应该用什么
2013年07月16日 04点07分
别听他的。这种问题你最好截图上,行号这些也要存在才好看
2013年07月16日 04点07分
我是从书上看到的。
2013年07月16日 04点07分
先说能看出错误的一点,你phone="update Phone",如果update和Phone是分别两个变量的话该这样写phone="+update+Phone+",如果是一个变量的话那你定义变量那里就应该已经报错了
2013年07月16日 04点07分
1