DataGrid display

Thread Solved

Join Date: Feb 2009
Posts: 35
Reputation: dev_kc is an unknown quantity at this point 
Solved Threads: 0
dev_kc dev_kc is offline Offline
Light Poster

DataGrid display

 
0
  #1
Mar 19th, 2009
This is the code i am using for displaying data into the DataGrid,bt its not working,plz help

Set DataGrid1.DataSource = rs
If rs.EOF And rs.BOF Then
MsgBox "Invalid Entry", vbOKOnly, "Stop!!"
Exit Sub
End If
Do
DataGrid1.Columns(0).Caption = rs!PS_NO
DataGrid1.Columns(1).Caption = rs!Name
DataGrid1.Columns(2).Caption = rs!DT_PREP
DataGrid1.Columns(3).Caption = rs!ADV
DataGrid1.Columns(4).Caption = rs!NATURE_EXP
While rs.EOF
Wend
Loop
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 10
Reputation: KSS is an unknown quantity at this point 
Solved Threads: 1
KSS's Avatar
KSS KSS is offline Offline
Newbie Poster

Re: DataGrid display

 
0
  #2
Mar 31st, 2009
Hi,

You can change the caption from the properties of the control or if u want to do it by code then do it only once..
For example:
Datagrid1.Columns(0).Caption = "Surname"
Datagrid1.Columns(1).Caption = "Name"
....
....
The loop was not necessary.
Check the attachment file...

Good luck...
Last edited by KSS; Mar 31st, 2009 at 11:30 am.
Attached Files
File Type: zip Datagrid.zip (40.9 KB, 14 views)
It's my pleasure to help you...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC