如果想做一个提交单货订的程序
表结构:
单号(key) 客户编号 型号 数量
123 03 A11 3
123 03 A11 4
.
.
.
想请问一下各位
C#是用什么控件可以一次保存多条数据到数据库.....
代码是怎么实现的......因为刚刚接触C#。
问题不知道是不是有点白痴尼。呵呵......
表结构:
单号(key) 客户编号 型号 数量
123 03 A11 3
123 03 A11 4
.
.
.
想请问一下各位
C#是用什么控件可以一次保存多条数据到数据库.....
代码是怎么实现的......因为刚刚接触C#。
问题不知道是不是有点白痴尼。呵呵......
SqlCommand cm = new SqlCommand();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
SqlCommandBuilder cb = new SqlCommandBuilder();
private void FrmPosiType_Load(object sender, EventArgs e)
{ cm = new SqlCommand("select * from HR_TrainType", cn);
da = new SqlDataAdapter(cm);
da.Fill(ds, "HR_TrainType");
this.dataGridView1.DataSource = ds.Tables["HR_TrainType"];
}
private void tsbSave_Click(object sender, EventArgs e)
{
cm = cn.CreateCommand();
cm.CommandText = "select * from HR_TrainType";
da = new SqlDataAdapter(cm);
cb = new SqlCommandBuilder(da);
da.Update(ds.Tables[0]);
this.dataGridView1.Update();
//MessageBox.Show("保存成功!");
}
如DATAGRIDVIEW控件可以实现。。的话
那么在2005那里怎么找不到DATAGRIDVIEW这个控件架。。
好闷......
真没有,我第二个是datalist
倒 你是web的 你来错地方了 不错思路差不多
对
知道为什么没有datagirdview
我新建的web
新建项目就看到了....
先了解一下个datagirdview
谢谢各位啊......
然后保存数据的时候,使用SqlCommandBuilder对象进行保存。
存储时执行个批操作呢