Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Steps for connect the database in asp.net with ms-access
and their related coding with example
Posted
Comments
ridoy 1-Sep-13 7:52am    
not a question.

1 solution

Your solution:

string ConnectString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + Server.MapPath("db\\database.mdb;");
OleDbConnection objCon;
OleDbCommand objCmd;
DataSet Ds = new DataSet();

string GetSql = string.Empty;
GetSql = "(SELECT * FROM table)";
using (objCon = new OleDbConnection(ConnectString))
{
    using (objCmd = new OleDbCommand(GetSql, objCon))
    {
        OleDbDataAdapter Da = new OleDbDataAdapter(objCmd);
        Da.Fill(Ds);
    }
}

you also can watch how to connect asp net with ms access [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900