本文介绍了数据不保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在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();

推荐答案



这篇关于数据不保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 06:18