Go Back   CodingForums.com > :: Server side development > ASP.NET

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-07-2009, 07:10 PM   PM User | #1
voxecho
New Coder

 
Join Date: Jan 2006
Location: South Central, KS
Posts: 81
Thanks: 2
Thanked 2 Times in 2 Posts
voxecho is an unknown quantity at this point
MSQL Access without Data Binding

Hello all -

Before I become Control Dependent, i would like to understand how Database Access and Direct manipulation of data in ASP.NET is achieved.

I am having trouble finding anything that addresses this with SQL Server (express) and was hoping someone here could help me.

in Classic ASP i would create a connection using server.createObject("ADODB.Connection") and then a RecordSet object to which i would feed a query string and if there are returns i could step through them with a

Do While Not RS.Eof
Loop

I've found some info on connecting to MySql DB which allows me similar (if more hoop jumping) access but how do i do this with MS Sql?

- Also, while on the topic, with MySql there is a DataReader object which allows me to loop through, but i can't seem to access the information by way of field name, only index. is this my only option?

Thank you in Advance
-Echo
voxecho is offline   Reply With Quote
Old 02-07-2009, 09:19 PM   PM User | #2
demtron
Regular Coder

 
Join Date: Jun 2008
Location: SE Wisconsin, US
Posts: 222
Thanks: 1
Thanked 20 Times in 20 Posts
demtron is on a distinguished road
First, take a look at http://msdn.microsoft.com/en-us/libr...sqlclient.aspx on MSDN Online. Depending on your needs, you'll want to look at the SqlConnection, SqlDataReader, SQLDataAdapter, and SQLCommand classes. One major difference in .Net is that, with the exception of the DataReader, all data is collected into a disconnected memory dataset so as not to consume server resources by leaving a data stream open for a long time. This does take a little getting used to.

Regarding the field name reference, see http://msdn.microsoft.com/en-us/library/f01t4cfy.aspx. I have never had a problem with this kind of access. If you're still stuck, post some code and we'll see what we can do.
__________________
Milwaukee Web Designer and SEO Milwaukee Firm specializing in ASP.Net, C#, VB.Net, SQL Server and Access.
demtron is offline   Reply With Quote
Old 02-08-2009, 05:53 PM   PM User | #3
voxecho
New Coder

 
Join Date: Jan 2006
Location: South Central, KS
Posts: 81
Thanks: 2
Thanked 2 Times in 2 Posts
voxecho is an unknown quantity at this point
thank you - that's what i finally figured out myself. the links on getting field names are very helpful.

-Echo
voxecho is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:57 AM.


Advertisement
Log in to turn off these ads.