How to call clear on a dataset table that may or may not exist?

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

Interesting issue. I can Clear or Reset the dataset or the datatables, but
what about clearing dataset tables that will not exist on the first pass?
For example, I populate some customer information into
ds.Tables("dtCustomers"), but every time a combo event occurs, I want to
flush the table and re-Fill it with new Customer data. Easy enough to do on
all succeeding passes once it has been created the first time
(ds.Tables("dtCustomers").Clear), but what's the most reliable way to
confirm whether or not the table exists so as to not create a null exception
on the initial Fill?
 
Interesting issue. I can Clear or Reset the dataset or the datatables, but
what about clearing dataset tables that will not exist on the first pass?
For example, I populate some customer information into
If (!ds.Tables.Contains("myTable"))

{

//do the create stuff

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top