i want an ASP.NET connecting to MS Access using C# code
-
i am stuck in a project for web based applecation i need to have a sample code for connecting asp.net with MS Access bsed on the C# technology if any one can help i will be glad
-
i am stuck in a project for web based applecation i need to have a sample code for connecting asp.net with MS Access bsed on the C# technology if any one can help i will be glad
Have a look at ASP.Net [^]examples. Have Sql examples there, basically all you do is change all the 'sql' to 'oledb'.
using System.Data.OleDb; OleDbConnection myConnection = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet OLEDB:Database Password=MyDbPassword;"); OleDbCommand myCommand = new OleDbCommand("select * from Authors", myConnection); myConnection.Open(); OleDbDataReader dr = myCommand.ExecuteReader(); ... myConnection.Close();
As for connection strings, have a look at www.connectionstrings.com[^]. HTH, :) -
Have a look at ASP.Net [^]examples. Have Sql examples there, basically all you do is change all the 'sql' to 'oledb'.
using System.Data.OleDb; OleDbConnection myConnection = new OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;Jet OLEDB:Database Password=MyDbPassword;"); OleDbCommand myCommand = new OleDbCommand("select * from Authors", myConnection); myConnection.Open(); OleDbDataReader dr = myCommand.ExecuteReader(); ... myConnection.Close();
As for connection strings, have a look at www.connectionstrings.com[^]. HTH, :)