Monday, January 19, 2009
Code for Microsoft Access Database Connection
Use this code for MS Access Database connectivity....
1. using System.Data.OleDb;
2. string FileDirectory = Server.MapPath("Database/admin.mdb");
OleDbConnection ocon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileDirectory.ToString() + "");
OleDbDataAdapter osap = new OleDbDataAdapter(str, ocon);
DataSet ds = new DataSet();
osap.Fill(ds, "temp");
GVProjectReports.DataSource = ds;
GVProjectReports.DataBind();
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment