关于数据库里的语句怎么在winform里面调用
winform吧
全部回复
仅看楼主
level 4
WX杨柳Y99 楼主
insert into spinfo1 (id,name,money,vipmoney) select id,name,money,vipmoney from spinfo where id=1 在winform里面怎么实现这句话
2015年05月13日 14点05分 1
level 1
string insert = string.Format("insert into 出库记录(ID,出库ID,物资ID,出库数量) values('{0}','{1}','{2}','{3}')", chukujl, chukuid, dataGridView6.Rows[i].Cells["dataGridViewTextBoxColumn17"].Value, dataGridView6.Rows[i].Cells["领用数量"].Value);
try
{
SqlCommand command1 = new SqlCommand(insert, DBhelper.connection);
DBhelper.connection.Open();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
DBhelper.connection.Close();
}
2015年05月16日 08点05分 2
我现在在写计算,但总是报错
2015年05月17日 01点05分
level 4
WX杨柳Y99 楼主
谢谢
2015年05月17日 01点05分 3
level 4
WX杨柳Y99 楼主
这个功能实现了,不过当我计算DataGridView里面的价格时却总是报错,或者只能得到一个物品的单价,而我需要的是所有物品的总价
2015年05月17日 01点05分 4
sql server里面自己测试下,能通过就不会报错了
2015年05月18日 08点05分
回复 veronxpr :谢谢,问题已经解决了
2015年06月03日 16点06分
1