Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 22, 2013 06:58 PM by kszymaniak
Feb 20, 2013 04:39 PM|LINK
On the surface, one would think this is simple. Apparently not.
Background: Accustomed to ASP VBScript. Updated to ASP.Net VB. All I want to do is draw data using a simple SQL Statement as you see below.
Dim dbconn As New SqlConnection
dbconn = New SqlConnection(ConfigurationManager.ConnectionStrings("dbConnectionString").ConnectionString)
Dim cmd As SqlCommand
Dim cmdString As String = "Select * from tblUsers where fldUserID=1"
cmd = New SqlCommand(cmdString, dbconn)
Label1.Text = **** normally in VBScript, I would put something like rs("fldUserValue") ****
Now what? ASP.Net has lots of datalists, readers, views, pagers, etc. All I want to do, is pull a single flippin' field from the table listed above and do a simple math calculation and assign it to a variable. Do I use a DataReader?
Feb 20, 2013 05:03 PM|LINK
Yes you want to loop through a datareader
Feb 20, 2013 08:51 PM|LINK
How do I pull the value from the field?
Feb 22, 2013 06:58 PM|LINK
Sir, you should use GridView control for displayng data. Do you know how populate data to GridView? You can not use only Label1.Text ==, it's nothing display.