DataTableAdapter Insert后怎样能写回数据库! 我生成data_table_adapter实例,调用了自己添加的InsertQuery函数,但是这样并不能把数据写入数据库。望各位提供帮助!谢谢注:InsertQuery在配置时测试是能够将数据写入数据库的。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我记得有个acceptchange啥的函数的 能说得具体点吗?DataTableAdapter好像没有这个方法! InsertCommand是否相关Parameter都赋值了 string file = this.openFileDialog1.FileName; //this.label1.Text = file; string[] texts = File.ReadAllLines(file, Encoding.Default); MainDataSet mds = new MainDataSet(); MainDataSetTableAdapters.TSelfTableAdapter tslef = new ABBS.MainDataSetTableAdapters.TSelfTableAdapter(); for (int i = 0; i < texts.Length;i++ ) { MainDataSet.TSelfRow row = (MainDataSet.TSelfRow)mds.TSelf.NewRow(); row.IdPrem = price;//价格 row.IdNo = texts[i].Substring(0, 14);//号码 row.status = 1;//状态 mds.TSelf.Rows.Add(row);//添加行 } int j = tslef.Update(mds.TSelf);//更新参考我这段代码是读取txt文本内容写入到数据库... 编写一个为u盘加密的程序 求wpf视频 .net中WEB收邮件中LumiSoft和jmail的比较。望高手赐教。。 .dll 组件 或者COM问题 编程中在移植程序时,如何处理链接地址变化的问题? 简单问题:c#WinForm中的ComboBox控件怎么设置用户不能输入? 如何在LISTVIEW中显示文件 byte的赋值范围 第一次用水晶报表就出现这样的问题? Vc#的源程序无法打开,请指点 请教做成系统服务的程序执行:Process.Start打开某个程序仍然看不到界面,如何解决 一个关于TcpClient的问题
DataTableAdapter好像没有这个方法!
string file = this.openFileDialog1.FileName;
//this.label1.Text = file;
string[] texts = File.ReadAllLines(file, Encoding.Default);
MainDataSet mds = new MainDataSet();
MainDataSetTableAdapters.TSelfTableAdapter tslef = new ABBS.MainDataSetTableAdapters.TSelfTableAdapter(); for (int i = 0; i < texts.Length;i++ )
{
MainDataSet.TSelfRow row = (MainDataSet.TSelfRow)mds.TSelf.NewRow();
row.IdPrem = price;//价格
row.IdNo = texts[i].Substring(0, 14);//号码
row.status = 1;//状态
mds.TSelf.Rows.Add(row);//添加行
}
int j = tslef.Update(mds.TSelf);//更新
参考我这段代码是读取txt文本内容写入到数据库...