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=<form field>"
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

Recommended Answers

All 2 Replies

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=<form field>"
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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.