codetoad.com
Home||ASP|ASP.Net|C++/C#|DHTML|HTML|Java|Javascript|Perl|VB|XML||CodeToadPlus!||Forums||RAM
Search Site:
Search Forums:
Connecting MS Access Database in ASP.net - C# asawari at 07:22 on Monday, April 24, 2006

Hi,

I'm trying to connect MS Access Database in ASP.net using C#.
How to go about it? What will be Provider, Connection String, DSN, DataSource?
If ODBC is required, which version? Which .net DLL is to be included as reference?

Thanks,
Asawari

Re: Connecting MS Access Database in ASP.net - C# htt at 17:16 on Thursday, April 27, 2006

hi, I'm also doing some searching on accessing MSAcess from C# and found some links that may be helpful. I think you need OLE DB.NET provider and use ADO.NET

http://www.dotnetspider.com/qa/Question23821.aspx

here is an excerpt

public void ConnectToAccess()
{
System.Data.OleDb.OleDbConnection conn = new
System.Data.OleDb.OleDbConnection();
// TODO: Modify the connection string and include any
// additional required properties for your database.
conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
@"Data source= C:\Documents and Settings\username\" +
@"My Documents\AccessFile.mdb";
try
{
conn.Open();
// Insert code to process data.
}
catch (Exception ex)
{
MessageBox.Show("Failed to connect to data source");
}
finally
{
conn.Close();
}
}



Re: Connecting MS Access Database in ASP.net - C# asawari at 02:22 on Friday, April 28, 2006

Hi
thanks for your reply. But main problem was to choose appropriate provider. ie. Microsoft.Jet.OLEDB.4.0

Then we can use OleDbAdapter and code further.

Thanks,
Asawari

Re: Connecting MS Access Database in ASP.net - C# JBelthoff at 14:37 on Tuesday, May 09, 2006

Try this: http://www.connectionstrings.com/

JB








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
deleting data from databse to dropdown list
matrix addition
Re: Storing data from HTML to Excel or TXT
Re: function within loop problem
Re: Ô‡´ò¥¯¥é¥Ö¤Ï ¥Æ©`¥é©`¥á¥¤¥É£ò£±£±¥¢¥¤¥¢¥ó ¤Î£··¬ ¤Ç¤¹
Re: Replace
Re: タイトリスト AP2アイアン 712�情�
Re: SMS from Perl using HTTP request
Re: Charl Schwartzel


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


Copyright codetoad.com 2001-2013