By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,564 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,564 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"David Lozzi" <dlozzi(remove-this)@delphi-ts.com> wrote in
news:#3*************@TK2MSFTNGP09.phx.gbl:
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/de...l=/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 (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.