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
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
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?
 

kunnie

Member
Joined
Dec 9, 2004
Messages
19
Programming Experience
1-3
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 ?
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
SELECT * FROM
WHERE Id = ' ken '

Ken is a string thus you need '
 

kunnie

Member
Joined
Dec 9, 2004
Messages
19
Programming Experience
1-3
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?
 

kunnie

Member
Joined
Dec 9, 2004
Messages
19
Programming Experience
1-3
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

 

mzim

Well-known member
Joined
Jun 3, 2004
Messages
187
Location
Other side of the rock
Programming Experience
1-3
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
 

kunnie

Member
Joined
Dec 9, 2004
Messages
19
Programming Experience
1-3
ok thanx.but onli retrive wads in the first column not rows??
 
Top Bottom