Problem with datatable.. Urgent..

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
i create datatable using code and add some columns in it..

the problems happen sometimes i load the datatable for the lst time, the
error happens at createing the column:
the error message merely as follows:
"the column [column name] already belongs to this datatable"

I don't know why ? 1st time load it should not content any column..
after i clear the databate content before creating the datatable, the
problem solve..
but, this problem is not solve yet. The problem arrise when i purposely
generate error during runtime, and close the webbrowser.
For this time i open the browser and load the page, the same error message
again//??why..??

any ideas..??

daniel/
 
Hi Daniel,
Seems like you are adding columns to a datatable with the same column names
already existing. Before adding the columns check for the columns count and
add the columns only if the datatable has no coulmsn. Like for ex
if not dt.columns.count > 0 then
'code to add columns here
end if

HTH
srini
 

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