Just connect to a SQL table, and pull some data!

Discussion in 'ASP .Net' started by David Lozzi, Aug 9, 2004.

  1. David Lozzi

    David Lozzi Guest

    It use to be so easy in ASP, but now in ASP.NET i'm lost and confused.

    I'm trying to connect to a SQL database, open a table via a SQL string. Then
    take the returning recordset and do what I want to it: pull two fields, pull
    all fields, loop through the recordset, etc.

    But i'm lost...

    --
    David Lozzi
    Web Applications/Network Specialist
    Delphi Technology Solutions, Inc.
    dlozzi(remove-this)@delphi-ts.com
     
    David Lozzi, Aug 9, 2004
    #1
    1. Advertising

  2. David Lozzi

    Lucas Tam Guest

    "David Lozzi" <dlozzi(remove-this)@delphi-ts.com> wrote in
    news:#:

    > It use to be so easy in ASP, but now in ASP.NET i'm lost and confused.
    >
    > I'm trying to connect to a SQL database, open a table via a SQL
    > string. Then take the returning recordset and do what I want to it:
    > pull two fields, pull all fields, loop through the recordset, etc.
    >
    > But i'm lost...



    Take a look at Microsoft's Data Access Application Block for .NET. These
    classes should simplify data access greatly:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-
    us/dnbda/html/daab-rm.asp

    But basically you:

    1. Connect to the database
    2. Create a Command object
    3. Populate the Command Connect with SQL and Connection
    4a. Execute the command object to return a data reader
    4b. Create a DataAdapter to fill a dataset

    Choose A or B depending if you want a datareader or dataset.

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
     
    Lucas Tam, Aug 9, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UnVkeQ==?=
    Replies:
    0
    Views:
    325
    =?Utf-8?B?UnVkeQ==?=
    May 11, 2005
  2. Replies:
    2
    Views:
    2,204
    Mike Treseler
    Jun 28, 2006
  3. Gummy
    Replies:
    2
    Views:
    361
    Gummy
    Feb 8, 2007
  4. Elton Wang

    How to pull the data out from two table and bind to repeater

    Elton Wang, Mar 28, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    165
    Elton Wang
    Mar 28, 2005
  5. Vagelis

    Pull data to SQL Server Ce

    Vagelis, Sep 15, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    139
    Vagelis
    Sep 15, 2003
Loading...

Share This Page