943,756 Members | Top Members by Rank

Ad:
Mar 19th, 2009
0

DataGrid display

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
dev_kc is offline Offline
35 posts
since Feb 2009
Mar 31st, 2009
0

Re: DataGrid display

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...
Attached Files
File Type: zip Datagrid.zip (40.9 KB, 22 views)
Last edited by KSS; Mar 31st, 2009 at 11:30 am.
KSS
Reputation Points: 11
Solved Threads: 3
Newbie Poster
KSS is offline Offline
21 posts
since Mar 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Sendkeys in excel vba
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: plz kindly help me





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC