Results 1 to 3 of 3

Thread: How to connect the web form to Ms Access using ASP.NET?

  1. #1
    Join Date
    Feb 2009
    Posts
    12

    How to connect the web form to Ms Access using ASP.NET?

    Hello!

    How to connect the web form to Ms Access using ASP.NET?

    Please guide me!

  2. #2
    Join Date
    May 2008
    Posts
    2,015

    Re: How to connect the web form to Ms Access using ASP.NET?

    The following steps will help you to conenct to a MS Access Database
    from your ASP.NET web form.

    Step 1 :
    Create an Asp.Net Web Application
    a)File->New->Project
    select ASP.NET Web Application
    Click Ok
    Step 2:
    In the Design View of the form , from the WebForms ToolBox
    Drag and Drop a Button
    Drag and Drop a DataGrid

    Step 3
    From the Data ToolBox,
    Drag and Drop a OleDBDataAdapter
    Now the Data Adapter Configuration Wizard Will Appear
    Click ON Next
    Click On New Connection
    In the Data Link Properties Form , Click On Provider
    Choose Microsoft Jet 4.0 OLE DB Provider(Or 3.51 OLE DB Provider, depending on MSAccess installed on your machine)
    Click On Next
    In the resulting window, Enter the complete path to your Local
    Access DataBase (For ex:C:\SampleDB\BooksDb.mdb).
    You can also browse the .mdb file using the Button next to the Text Box.
    Click on Test Connection to make sure that the DB exists and that you are able to connect to the Database.

    Dont forget to enter the password information if you are using a password for your database.
    Click on Ok.
    Step 4
    Click on Next in the Data Adapter Configuration Wizard
    Make sure the "Use Sql Statements" Radio Button is Checked and Click Next
    Enter the SQL query in the Resulting window (For ex: Select * from Books)
    (Or You can use the Query Builder to build your queries)
    Click Next
    Click Finish
    Now you are all set to retreive the data from the DataBase you specified.
    Step 5
    Now In the Button Click Event, include the following Statements
    Code:
    DataSet dataset=new DataSet();
    this.oleDbDataAdapter1.Fill(dataset);
    this.DataGrid1.DataSource=dataset;
    DataGrid1.DataBind();
    Compile and run your program. If you click the Button, you can see the Datagrid is being populated by the data from the DataBase.

  3. #3
    Join Date
    May 2008
    Posts
    115

    Re: How to connect the web form to Ms Access using ASP.NET?

    http://msdn.microsoft.com/library/de...components.asp

    I see from this page ms recommends using SOAP as an alternative for remote db access.

Similar Threads

  1. Access - form with a dropdown menu
    By Logan 2 in forum Windows Software
    Replies: 5
    Last Post: 21-01-2010, 01:18 PM
  2. Access vba code form issue
    By Jaiwanti in forum Software Development
    Replies: 3
    Last Post: 06-07-2009, 12:32 PM
  3. How to create access clear button in the form using MS ACCESS
    By T0tal L0$$ in forum Software Development
    Replies: 3
    Last Post: 09-06-2009, 10:59 AM
  4. Form SubForm ACCESS 2007
    By streetprods in forum Software Development
    Replies: 2
    Last Post: 30-05-2009, 03:18 PM
  5. To access a text field from another form
    By Sanket07 in forum Software Development
    Replies: 6
    Last Post: 06-02-2009, 05:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •