16,012,468 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by farout9999 (Top 4 by date)
farout9999
18-Oct-11 4:25am
View
thanks got the value showing up
farout9999
18-Oct-11 2:54am
View
got some problem.. got the value pass to when debugging but it wont show on the textbox the value
farout9999
14-Jul-11 21:32pm
View
sir how can i use this sample code so i could display my data in my grid.. thanks
<pre>
Private Sub PopulateDataGridView()
Dim row0 As String() = {"11/22/1968", "29", "Revolution 9", _
"Beatles", "The Beatles [White Album]"}
Dim row1 As String() = {"1960", "6", "Fools Rush In", _
"Frank Sinatra", "Nice 'N' Easy"}
Dim row2 As String() = {"11/11/1971", "1", "One of These Days", _
"Pink Floyd", "Meddle"}
Dim row3 As String() = {"1988", "7", "Where Is My Mind?", _
"Pixies", "Surfer Rosa"}
Dim row4 As String() = {"5/1981", "9", "Can't Find My Mind", _
"Cramps", "Psychedelic Jungle"}
Dim row5 As String() = {"6/10/2003", "13", _
"Scatterbrain. (As Dead As Leaves.)", _
"Radiohead", "Hail to the Thief"}
Dim row6 As String() = {"6/30/1992", "3", "Dress", "P J Harvey", "Dry"}
With Me.songsDataGridView.Rows
.Add(row0)
.Add(row1)
.Add(row2)
.Add(row3)
.Add(row4)
.Add(row5)
.Add(row6)
End With
With Me.songsDataGridView
.Columns(0).DisplayIndex = 3
.Columns(1).DisplayIndex = 4
.Columns(2).DisplayIndex = 0
.Columns(3).DisplayIndex = 1
.Columns(4).DisplayIndex = 2
End With
End Sub
</pre>
farout9999
14-Jul-11 12:21pm
View
coz i manually set my grid header but when i tried to populate it ..it was change with fieldname
this is my code
<pre>
Private Sub populateGrid()
Dim msg As New clsMessage
Dim ds As New DataSet
Dim connectionString = New SqlConnection(getSqlConnectionString)
Dim strSQL As String
'Dim strColOrderBy As String
'Dim strColumns As String
Try
strSQL = "SELECT categoryid, category FROM category WHERE is_delete <> 1"
Using conn As New SqlConnection(getSqlConnectionString)
conn.Open()
Using adapterLib As New SqlDataAdapter(strSQL, connectionString)
adapterLib.Fill(ds, "category")
'dgMember.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Raised
dgvCategory.DataSource = ds.Tables("category")
End Using
End Using
Catch ex As Exception
msg.setMessage = "Ooops, an unexpected error has been encountered." & Chr(13) & ex.Message
msg.setIcon = MessageBoxIcon.Warning
msg.setButton = MessageBoxButtons.OK
MessageBox.Show(msg.getMessage, "Error", msg.getButton, msg.getIcon)
msg = Nothing
End Try
End Sub
</pre>
did i get it right?