Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15057

VS 2010 Data source

$
0
0
I am currently trying to understand the theory in relating to data sources ay data is bound,
Is there any functional difference betweed the following, and which is better ?


Code:

        Try
            con.Open()
            da.Fill(dt)
            bs.DataSource = dt
            Me.DataGridView1.DataSource = bs
            Me.BookIdTextBox.DataBindings.Add("Text", bs, "BookId")
        Catch ex As Exception
            MessageBox.Show(ex.ToString)

To this

Code:


        Try
            con.Open()
            da.Fill(dt)
            Me.DataGridView1.DataSource = dt
            Me.BookIdTextBox.DataBindings.Add("Text", bs, "BookId")
        Catch ex As Exception
            MessageBox.Show(ex.ToString)


Viewing all articles
Browse latest Browse all 15057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>