I have been asked to use data grid in my proj,bt i dnt knw hw to use this,please help...
On click of search btn,the data should be displayed in the grid and textbox,I know how to display in the text box,but dnt knw anything abt this grid........
PLEASE HELP:S

just try :

Dim squery as String
Dim conn as ADODB.Connection
Dim Cm as ADODB.Command
Dim rs as ADODB. Recordset

squery = "": squery = "Select * from tblGrade where StudentNumber=" & txtStudentNum.Text & ""
Set Cm = New ADODB.Command
With Cm
Set .ActiveConnection = conn
.CommandText = squery
.CommandType = adCmdText
.CommandTimeout = 60
End With
Set rs = New ADODB.Recordset
With rs
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockPessimistic
.Open Cm
End With

Set dgGrade.DataSource = rs

hope this helps =)

What is dgGrade,and where should i write this code???????????

as what you have said, on the SEARCH comman button. dgGrade is just name of the datagrid control. make some edit regarding the statement I have posted, try to edit, add/delete some statement, depending on what your system wants to do. it is just a guide. (",)..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.