2011-08-16 50 views
0
String conn="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\\Data.accdb"; 
string query = "Insert Into Venue values(@venueID,@vanueName)"; 
OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, conn); 
OleDbCommandBuilder cBuilder = new OleDbCommandBuilder(dAdapter); 
DataTable dTable = new DataTable(); 
dTable.Rows.Add("@vanueName", textBox1.Text); 
dAdapter .Fill (dTable); 
dataGridView1 .DataSource =dTable ; 

回答

0

我不太清楚Fill方法更新數據庫

+0

所以,我應該爲此做什麼, –

+0

首先確保您通過執行ExecuteNonScalar方法更新數據庫表。 – Zenwalker

+0

不,我仍然面臨一個問題,請你寄給我代碼,或者使我的代碼真實 –

相關問題