PC Review


Reply
Thread Tools Rate Thread

Datatable as bindingsource datasource

 
 
John
Guest
Posts: n/a
 
      3rd Feb 2009
Hi

Would appreciate if someone can provide an example of a datatable being used
as datasource for binidngsource. I would like to be able to change the sql
for datatable input from time to time during the operation of the app.

Thanks

Regards


 
Reply With Quote
 
 
 
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      3rd Feb 2009
John,

In my idea is this an answer on your question.

\\\
Dim dbs As New BindingSource
Dim dgv As New DataGridView
Controls.Add(dgv)
Dim dt As New DataTable
Dim dc As New DataColumn
dt.Columns.Add(dc)
Dim dr1 = dt.NewRow
dr1.Item(0) = "John"
dt.Rows.Add(dr1)
dbs.DataSource = dt
dgv.DataSource = dbs
///

However, I assume that this is done by you all with the designer.

Probably you only need before you do a fill of your datatable.

dt.clear

A fill does not clear a datatable or dataset in advance

Cor

"John" <(E-Mail Removed)> wrote in message
news:uKJ$(E-Mail Removed)...
> Hi
>
> Would appreciate if someone can provide an example of a datatable being
> used as datasource for binidngsource. I would like to be able to change
> the sql for datatable input from time to time during the operation of the
> app.
>
> Thanks
>
> Regards
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Understanding BindingSource, DataSource, DataAdapter. Mr. X. Microsoft VB .NET 0 25th Jun 2010 11:19 AM
BindingSource vs DataSource Bresco Microsoft Dot NET Framework Forms 1 26th Jan 2009 08:25 AM
Bindingsource.datasource Error in desing Alhambra Eidos Kiquenet Microsoft C# .NET 1 25th Jun 2008 02:01 PM
BindingSource set DataSource and DataMember atomically? Doug Crawford Microsoft Dot NET Compact Framework 0 19th Sep 2007 06:55 PM
BindingSource.DataSource - Do I need InvokeRequired? Spam Catcher Microsoft VB .NET 0 29th Jan 2007 09:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:17 PM.