Retrieve data

kunnie

Member
Joined
Dec 9, 2004
Messages
19
Programming Experience
1-3
Hi! when we retrieve data,can we retrive it according to the title instead of ordinal number?and can we retrieve data according to rows instead of column?please I need help thanks
 
OK, you've posted this several times so I'll bite.

First. when you retrieve data from a database, you retreive the rows of data containing the columns that you have asked for in the SQL statement. In the SQL statement, you can include a WHERE clause which filters the rows of data based upon some criteria.

What do you mean by ordinal number?
 
if my column is name Id.And i have a name whitn id that is ken.therefore by coding should goes like this SELECT * FROM TABLE WHERE Id = ken ?
 
Thanks but still have a prob

May I know how do I retrieve from the data base?like I want my label1 to be equal to the text I want to retrieve how do I do it?
 
Heres a sample of my code That I had written and I odnno how to go on

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim custReader As OleDb.OleDbDataReader

Dim a2 As String

With OleDbConnection1

.Open()

Dim comm As OleDb.OleDbCommand

comm = OleDbConnection1.CreateCommand

comm.CommandText = "SELECT * FROM Table1 WHERE Illness = 'Cough'"

custReader = comm.ExecuteReader

With custReader

??????????
End With
End With

End Sub

End
Class

 
if you have label control..
try like this
VB.NET:
 with custReader
 	label1.text = custReader(0).tostring----> return 1st column of your table
 end with
 
Back
Top