954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Connecting and retrieving information from an MSSQL Table

I have programmed a web application using classic ASP and MSSQL, but our company is upgrading to ASP.NET and for my next project I thought I would the application in pure VB.NET.

However, I am struggling to get my application to talk correctly to the MSSQL tables. I know my connection string is correct. But can anyone tell me how to do this?

1. Send SQL Query such as "select * from users where userid="
2. Read the result of the query

I used to use ADODB and recordsets but ASP.NET appears to use something called datasets and I am really struggling to get my head around how this works.

Every example talks about displaying the data. I want to read the data not show it.

Any help appreciated or some clue as to how to resolve this issue

zaphod2003
Newbie Poster
4 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

OK, are you doing this in ASP.NET with VB.Net Code behind or a Visual Basic.Net application? From your post, I get the feeling that it is in ASP.NET (.."I thought I would the application in pure VB.NET" = my confusion..)

Saying that, here is a very good overview of ADO.NET LINK

The Dataset is a "snapshot" of the data in the database at that moment in time. The idea behind ADO.NET is not the maintain a constant connection to the DB (i.e. hogging resources and processor time), but rather to grab the set of data requested (i.e dataset).

Datasets are much like a recordset.

The changes from ASP (Classic) to ASP.NET is the implementation of true OOP (Object Oriented Programming). Abstraction....encapsulation, and instatiation.

Another very good site, that I recommend you read through : Excellent Overview (with code)

Hope this helps

Be sure to check out the tutorials as well.

I have programmed a web application using classic ASP and MSSQL, but our company is upgrading to ASP.NET and for my next project I thought I would the application in pure VB.NET.

However, I am struggling to get my application to talk correctly to the MSSQL tables. I know my connection string is correct. But can anyone tell me how to do this?

1. Send SQL Query such as "select * from users where userid=" 2. Read the result of the query

I used to use ADODB and recordsets but ASP.NET appears to use something called datasets and I am really struggling to get my head around how this works.

Every example talks about displaying the data. I want to read the data not show it.

Any help appreciated or some clue as to how to resolve this issue

Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 

As most comprehensive answer. I will certainly check these links out thanks a bundle, it was really driving me nutz.

zaphod2003
Newbie Poster
4 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You