Results 1 to 4 of 4

Thread: How to Access DB as datasource through ASP.Net page

  1. #1
    Join Date
    May 2008
    Posts
    248

    How to Access DB as datasource through ASP.Net page

    I am using MS.Access database and ,binding the gridview with Access datasource, I am trying to update the multiple fields in a particular row ,but it is not supporting, another thing is that I want to have a drop-down menu where users can click to select different customers within the DB and have it load their respective data. If anyone has done or comes across this please let me know.

    Any suggestions would be appreciated

  2. #2
    Join Date
    Jan 2009
    Posts
    134

    Re: How to Access DB as datasource through ASP.Net page

    You can write code to access data using classes from the System.Data namespace (commonly referred to as ADO.NET) and from the System.Xml namespace. you should do some of those things if you want to build a proper n-tier system with separate data access and business tiers. You need to make a Customer.cs class within C# with public fields for each column in the Customers table in the DB, and somehow use it to create a Customer object that will contain the information about the selected customer.

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: How to Access DB as datasource through ASP.Net page

    reate the connection to the database in the Page_Load subroutine. ASP.NET includes two types of server controls that participate in the declarative data binding model: data source controls and data-bound controls. A new OleDbConnection class with a connection string which identifies the OLE DB provider and the location of the database.

    Code:
    <script runat="server">
    sub Page_Load
    dim dbconn
    dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
    data source=" & server.mappath("northwind.mdb"))
    dbconn.Open()
    end sub
    </script>

  4. #4
    Join Date
    Jan 2009
    Posts
    134

    Re: How to Access DB as datasource through ASP.Net page

    ObjectDataSource Enables you to work with a business object or other class and create Web applications that rely on middle-tier objects to manage data. Then you put your actual database code in a class that meets the Object data source contract requirements. Data source controls are ASP.NET controls that manage the tasks of connecting to a data source and reading and writing data. Data source controls do not render any user interface, but instead act as an intermediary between a particular data store.

Similar Threads

  1. Want to access the reliance modem page
    By silvery in forum Networking & Security
    Replies: 9
    Last Post: 23-11-2011, 08:26 PM
  2. Binding Java object to XML Datasource GWT
    By Bambina in forum Software Development
    Replies: 4
    Last Post: 27-10-2009, 07:06 PM
  3. Unable to access the login page
    By Gluteus in forum Operating Systems
    Replies: 3
    Last Post: 25-04-2009, 07:15 PM
  4. Unable to access ASP Page
    By Gangesh in forum Networking & Security
    Replies: 2
    Last Post: 30-12-2008, 04:46 PM
  5. How can I remove a particular web page's access from history?
    By Icarusul in forum Technology & Internet
    Replies: 4
    Last Post: 10-10-2008, 06:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,953,984.54403 seconds with 17 queries