| | |
DataGrid display
Thread Solved |
•
•
Join Date: Feb 2009
Posts: 35
Reputation:
Solved Threads: 0
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
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
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...
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.
It's my pleasure to help you...
![]() |
Similar Threads
- DataGrid with Images (ASP.NET)
- Display table in datagrid (VB.NET)
- Datagrid and Recordset in VB 6.0 (Visual Basic 4 / 5 / 6)
- Datagrid scroll bar and field/column name (ASP.NET)
- Datagrid (ASP.NET)
- problems in displaying data in datagrid in ASP.NET (ASP.NET)
- How to highlight the datagrid row..... (JavaScript / DHTML / AJAX)
- another one...selecing rows in datagrid and sorting with column headers (VB.NET)
- uploading jpeg file (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Sendkeys in excel vba
- Next Thread: plz kindly help me
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





