using System.Data.OleDb; private void Form1_Load(object sender, EventArgs e) { string path = @"E:\Data\Myoffice\Access\"; string DataBase_Name = "MyDataBase.accdb"; string Table_Name = "Book"; string Sql_Comnd = "select * from " + Table_Name + " Where Date = 2010/07/11 12:00:00 AM"; OleDbConnection con = new OleDbConnection(); con.ConnectionString = con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source = " + path + DataBase_Name; OleDbDataAdapter da = new OleDbDataAdapter( Sql_Comnd , con); DataSet ds = new DataSet(); con.Open(); da.Fill(ds, Table_Name); dataGridView1.DataSource = ds.Tables[Table_Name].DefaultView; con.Close(); }
Where Date = #2010/07/11 12:00:00 AM#
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)