Hola para leer datos sería así:
Código PHP:
myConnection = New SqlConnection("server=localhost;uid=sa;pwd=;database=pubs")
'establishing connection. you need to provide password for sql server
Try
myConnection.Open()
'opening the connection
myCommand = New SqlCommand("Select * from discounts", myConnection)
'executing the command and assigning it to connection
dr = myCommand.ExecuteReader()
While dr.Read()
'reading from the datareader
MessageBox.Show("discounttype" & dr("discounttype").ToString())
MessageBox.Show("stor_id" & dr("discounttype").ToString())
displaying the data from the table
End While
dr.Close()
myConnection.Close()
Catch e As Exception
End Try
podes ver mas sobre como obtener datos aca:
http://www.elguille.info/NET/adonet/...cuteScalar.htm