数据集插入记录返回0,请高手帮助
我是WINFORM ACCESS数据库 没有提示任何错误,只是返回UPDATA返回0
代码如下
string cmdselect = "SELECT * FROM [base] where 0> 1 ";
string myConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + System.Windows.Forms.Application.StartupPath + "\\database\\esenge.mdb " + ";User ID=admin;Jet OLEDB:Database Password=lq~b819_531~by ";
OleDbConnection conn = new OleDbConnection(myConnectionString);
conn.Open();
OleDbCommand command = conn.CreateCommand();
command.CommandText = cmdselect; //SQL命令赋值 ,以获得结构
//command.CommandType = CommandType.TableDirect;
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
//adapter.SelectCommand = cmdselect;
DataSet ds = new DataSet();
adapter.Fill(ds, cmdselect);
adapter.TableMappings.Add( "base ", "base ");
DataRow dr = ds.Tables[0].NewRow(); ;
//ds.Clear();//清除该表记录,只保留结构
//DataRow dr = ds.Tables[0].NewRow();//增加新的一行;
dr[0] = nform0.Text;