could not find installable ISAM

May 31 2004 6:55 PM
Hi guys Please help me with this one......i have got to urgently finish this project... it is a database connection related problem. I tried reading some of the forums available online.. tried some out but still the same error. So kindly help me someone !! My code is below : using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Data.OleDb; namespace WebApplication2 { /// /// Summary description for WebForm1. /// public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.Label Label1; //private System.Data.OleDb.OleDbConnection conn; //private System.Data.DataSet dset; //private System.Data.OleDb.OleDbCommand cmd; //private System.Data.OleDb.OleDbDataAdapter adapter; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.JET.OLEDB.4.0;DataSource=C:\Documents and Settings\robotfan\My Documents\Visual Studio Projects\WebApplication2\test.mdb"); OleDbCommand cmd = new OleDbCommand("SELECT * FROM names", conn); //conn.Open(); OleDbDataAdapter adapter = new OleDbDataAdapter(); adapter.SelectCommand = cmd; DataSet ds = new DataSet(); adapter.Fill(ds,"names"); foreach (DataRow dr in ds.Tables["names"].Rows) { Label1.Text += string.Format("{0} {1}
",dr["FirstName"],dr["LastName"]); } } #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion } }

Answers (1)