C# Exporting to Access Data Base missing rows

  • Thread starter Thread starter Booney440
  • Start date Start date
B

Booney440

Guest
When I export my datagrid to Access it not exporting all the rows. I'm using Spire.DataExport and found this code.

I don't see where it's limiting the rows. Any ideas

Thanks



private void btn_Export_Click(object sender, EventArgs e)
{

System.Data.OleDb.OleDbConnection oleDbConnection1
= new System.Data.OleDb.OleDbConnection();
oleDbConnection1.ConnectionString
= @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Roster.accdb";

System.Data.OleDb.OleDbCommand oleDbCommand1
= new System.Data.OleDb.OleDbCommand();
oleDbCommand1.CommandText = "select * from [Test Trial Roster] "; ////* means all database column
oleDbCommand1.Connection = oleDbConnection1;

Spire.DataExport.Access.AccessExport accessExport1
= new Spire.DataExport.Access.AccessExport();

accessExport1.DatabaseName = "Roster Export File.accdb";
accessExport1.DataFormats.CultureName = "zh-CN";
accessExport1.DataFormats.Currency = "c";
accessExport1.DataFormats.DateTime = "yyyy-M-d H:mm";
accessExport1.DataFormats.Float = "g";
accessExport1.DataFormats.Integer = "g";
accessExport1.DataFormats.Time = "H:mm";
accessExport1.SQLCommand = oleDbCommand1;
accessExport1.TableName = "ExportData";

oleDbConnection1.Open();
accessExport1.SaveToFile();
}







Booney440

Continue reading...
 

Similar threads

Back
Top