Click here to Skip to main content
15,888,242 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

How to connect MSAccess 2007 database in ASP.NET-C#.
i am using visual studio 2008.iam trying to build a website to host in intranet.


thanks in advance
can any one help me....
Posted
Updated 15-Nov-11 19:57pm
v2
Comments
Member 8753759 1-Mar-14 5:31am    
i am using .net framework 4.0 and developing web application through asp.net c#. i would like to know if i can insert and view data through ms access file rather than ms sql server2008? please provide suitable answer.

 
Share this answer
 
Comments
Ragi Gopi 16-Nov-11 1:05am    
Sorry
its not clear for me
as iam new to asp.net
plz help
import the namespace
C#
using System.Data.OleDb;


you can write like this:

C#
string connection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourDatabaseName.mdb;Persist Security Info=True";
OleDbConnection cn = new OleDbConnection(connection); 
OleDbDataAdapter da = new OleDbDataAdapter("Select * from <tablename>", cn);
DataSet ds = new DataSet();
da.Fill(ds);
</tablename>
 
Share this answer
 
Comments
Ragi Gopi 16-Nov-11 1:06am    
am using ms access 2007
Swapna33 16-Nov-11 4:20am    
it works with ms access 2007
If you put mdf file on network drive on server, change connection string as well.and to connect with database see
ADO.NET Application using MS Access 2007 database
and more results on google
Google
 
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