|
-
Sep 27th, 2005, 05:50 AM
#1
Thread Starter
Addicted Member
Retrieving Data
to retrieve data im using this code:
SqlConnection1.Open()
Dim x As SqlClient.SqlDataReader
Dim s
SqlCommand1.CommandText = "Select sum(I_AMOUNT) from INVOICES where I_YEAR = '" & ComboBox6.Text & "'"
x = SqlCommand1.ExecuteReader()
While (x.Read())
s = x.GetValue(0)
End While
x.Close()
TextBox1.Text = s
SqlConnection1.Close()
this code allows me to retrieve only one row of data
what should i do in order to retrieve many rows and display them in a datagrid
is there something to use instead of x.getvalue(0)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|