Click here to Skip to main content
15,886,724 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: vb.net Pin
Luc Pattyn22-Dec-11 1:07
sitebuilderLuc Pattyn22-Dec-11 1:07 
AnswerRe: vb.net Pin
RaviRanjanKr23-Dec-11 10:27
professionalRaviRanjanKr23-Dec-11 10:27 
Questiongoogle maps in vb6 application Pin
Preeti197921-Dec-11 20:14
Preeti197921-Dec-11 20:14 
AnswerRe: google maps in vb6 application Pin
thatraja21-Dec-11 21:53
professionalthatraja21-Dec-11 21:53 
AnswerRe: google maps in vb6 application Pin
Dave Kreskowiak22-Dec-11 3:39
mveDave Kreskowiak22-Dec-11 3:39 
AnswerRe: google maps in vb6 application Pin
Eddy Vluggen23-Dec-11 7:31
professionalEddy Vluggen23-Dec-11 7:31 
QuestionHow to read relational databases Pin
Chris_B8421-Dec-11 7:28
Chris_B8421-Dec-11 7:28 
AnswerRe: How to read relational databases Pin
Framework .l.21-Dec-11 15:27
Framework .l.21-Dec-11 15:27 
well, if you use VB.NET 2010, then this is the example code to fill binded datagrid.

Private StaffAdapter As New Objects.DataAdapters.StaffAdapter()

        Private Sub Staff_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            Me.LoadData()
        End Sub


Public Sub LoadData()
            Me.LoadData(0)
        End Sub
        Public Sub LoadData(ByVal Id As Long)
            Me.DataSet.Staff.Rows.Clear()
            Me.StaffAdapter.FillStaff(Me.DataSet.Staff)

            If ID <> 0 Then
                Me.StaffBindingSource.Position = Me.StaffBindingSource.Find("IdStaff", Id)
            End If
        End Sub


and this one is my class

Public Sub FillStaff(ByVal Table As DataTable)
            Dim cnn As New SqlConnection([Global].Variables.Config.Connection.String)
            Dim cmd As SqlCommand = cnn.CreateCommand()
            cnn.Open()

            cmd.CommandText = "select * from Staff"
            Table.Load(cmd.ExecuteReader())

            If cnn IsNot Nothing Then
                cnn.Dispose()
            End If
            If cmd IsNot Nothing Then
                cmd.Dispose()
            End If
        End Sub


modified 21-Dec-11 21:37pm.

QuestionSourcecode for control Scanner Pin
Muhammad Riadi20-Dec-11 3:01
Muhammad Riadi20-Dec-11 3:01 
AnswerRe: Sourcecode for control Scanner Pin
Dave Kreskowiak20-Dec-11 3:32
mveDave Kreskowiak20-Dec-11 3:32 
AnswerRe: Sourcecode for control Scanner Pin
Smithers-Jones20-Dec-11 22:52
Smithers-Jones20-Dec-11 22:52 
QuestionHow to delete record from DataGrid control VB Pin
rizaky201119-Dec-11 14:35
rizaky201119-Dec-11 14:35 
AnswerRe: How to delete record from DataGrid control VB Pin
Dave Kreskowiak20-Dec-11 3:33
mveDave Kreskowiak20-Dec-11 3:33 
GeneralRe: How to delete record from DataGrid control VB Pin
rizaky201120-Dec-11 19:12
rizaky201120-Dec-11 19:12 
GeneralRe: How to delete record from DataGrid control VB Pin
Dave Kreskowiak21-Dec-11 1:38
mveDave Kreskowiak21-Dec-11 1:38 
AnswerRe: How to delete record from DataGrid control VB Pin
qyasn20-Dec-11 23:24
qyasn20-Dec-11 23:24 
QuestionOracle forms 10g Pin
Member 380338516-Dec-11 21:06
Member 380338516-Dec-11 21:06 
AnswerRe: Oracle forms 10g Pin
Dave Kreskowiak17-Dec-11 3:33
mveDave Kreskowiak17-Dec-11 3:33 
QuestionSaving rtf-file Pin
jtpaa15-Dec-11 20:00
jtpaa15-Dec-11 20:00 
QuestionRe: Saving rtf-file Pin
Framework .l.15-Dec-11 20:31
Framework .l.15-Dec-11 20:31 
AnswerRe: Saving rtf-file Pin
jtpaa15-Dec-11 20:35
jtpaa15-Dec-11 20:35 
GeneralRe: Saving rtf-file Pin
Framework .l.15-Dec-11 22:02
Framework .l.15-Dec-11 22:02 
GeneralRe: Saving rtf-file Pin
Richard MacCutchan15-Dec-11 22:34
mveRichard MacCutchan15-Dec-11 22:34 
GeneralRe: Saving rtf-file Pin
jtpaa15-Dec-11 22:52
jtpaa15-Dec-11 22:52 
GeneralRe: Saving rtf-file Pin
Richard MacCutchan15-Dec-11 23:35
mveRichard MacCutchan15-Dec-11 23:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.