Click here to Skip to main content
13,196,126 members (52,240 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
i'm using vb 2010 ultimate c#.
i can't find this provider Microsof Jet 4.0 ILE DB Provider
i tried to connect access db with my project but i have problem using this OleDbDataAdapter

how can i do it?
Posted 30-Dec-12 6:16am
Updated 30-Dec-12 6:25am
v2
Comments
Zoltán Zörgő 30-Dec-12 12:43pm
   
You can't find, and you have problems are not very informative... Could you please post the few rows of code where you try to establish the connection? Btw: there is nothing like "vb 2010 ultimate c#"... Either VB.
Member 8475480 30-Dec-12 15:50pm
   
sorry i meen vs
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Supposing you need only the proper connection string syntax, look around here: http://www.connectionstrings.com/access-2007[^].

Start with this short tutorial: http://www.dscripts.net/2009/01/20/connect-to-microsoft-access-mdb-database-using-csharp/

Here is a screencast in this topic: http://www.youtube.com/watch?v=uw9vVvgqVMk[^]
  Permalink  
Comments
Member 8475480 30-Dec-12 15:50pm
   
thanks this was helpfull
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

maybe you are saying something like this..

Provider=Microsoft.Jet.OLEDB.4.0;Data Source= 'your database path.
  Permalink  
Comments
Member 8475480 30-Dec-12 15:51pm
   
thanks this was helpfull
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

There are two ways to connect to an Access database:

1)Visually, with design-time tools.
2)Programmatically.

Programmatically:
include these namespaces in your project:
using System.Data;
using System.Data.OleDb;



and have a example for string connection:
public void Accessdata()
{
    System.Data.OleDb.OleDbConnection conn = 
                                     new System.Data.OleDb.OleDbConnection();
 
    conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" +
        @"Data source= C:\Documents and Settings\username\" +
        @"My Documents\AccessFile.mdb"; // connection string 
    try
    {
        conn.Open();
        // Insert code for operations.
    }
        catch (Exception ex)
    {
        MessageBox.Show("Failed to connect to data source");
    }
    finally
    {
        conn.Close();
    }


Visually, with design-time tools

Creating Connections to Access Databases[^]
  Permalink  
Comments
Member 8475480 30-Dec-12 15:51pm
   
thanks this was helpfull
working on it
Abhishek Pant 30-Dec-12 15:54pm
   
If helpful dont forget to vote and accept the answer so that If can help others when they search

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.171019.1 | Last Updated 30 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100