问题描述
我想在MS Access中插入数据
该查询完全执行,所有操作均以coreect方式进行,但是当我打开表时,它不包含输入的数据
代码是
字符串SaveConnString ="Provider = Microsoft.Jet.OLEDB.4.0; Data Source = UI.mdb";
OleDbConnection ConnForSaveTabs =新的OleDbConnection(SaveConnString);
字符串SaveCommand = @插入到选项卡(名称,标题)中的值(""+ txtname.Text +",""+ txtcaption.Text +"'');
OleDbCommand CommandForSave =新的OleDbCommand(SaveCommand,ConnForSaveTabs);
CommandForSave.ExecuteNonQuery();
i want to insert data in MS access
The query execute corectly,everything going in coreect manner but when i open the table it does not contain entered data
the code is
string SaveConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=UI.mdb";
OleDbConnection ConnForSaveTabs = new OleDbConnection(SaveConnString);
string SaveCommand = @" Insert into Tabs (Name,Caption) values(''" + txtname.Text + "'',''" + txtcaption.Text + "'') ";
OleDbCommand CommandForSave = new OleDbCommand(SaveCommand, ConnForSaveTabs);
CommandForSave.ExecuteNonQuery();
推荐答案
这篇关于数据不保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!