using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data;
namespace My_Project
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string sFilePath = Server.MapPath("StudentDb.mdb");
DataTable dt;
OleDbConnection conn= new OleDbConnection("Provider=Microsoft.Jet.OLEB.4.0;Data Source=" + sFilePath + "; Persist Security Info=False;");
using(conn)
{
if(conn.State==ConnectionState.Closed){
conn.Open();
}
OleDbCommand cmd = new OleDbCommand("Select * from Students",conn);
OleDbDataAdapter oDA = new OleDbDataAdapter(cmd);
dt = new DataTable();
oDA.Fill(dt);
}
gvDetails.DataSource=dt;
gvDetails.DataBind();
}
}
}
}
im getting this error
An exception of type 'System.InvalidOperationException' occurred in System.Data.dll but was not handled in user code
Additional information: The 'Microsoft.Jet.OLEB.4.0' provider is not registered on the local machine.
please help me regarding this...