|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get error when try to set DataColumn variable againOn the second call to the below method body, I get the error: A column
named 'Full Name' already belongs to this Data Table. In C++, what I would do is either set col to null on exit from the method, or only do the assignment if col is emply. Explicitly, how would I do these 2 things in VB? Dim col As DataColumn col = dsAdoSbs.Employees.Columns.Add("FullName", System.Type.GetType("System.String")) Thanks, Christopher Lusardi Christopher Lusardi wrote:
Show quoteHide quote >On the second call to the below method body, I get the error: A column Try deleting the column. Then you can add it again later.>named 'Full Name' already belongs to this Data Table. In C++, what I >would do is either set col to null on exit from the method, or only do >the assignment if col is emply. Explicitly, how would I do these 2 >things in VB? > >Dim col As DataColumn > >col = dsAdoSbs.Employees.Columns.Add("FullName", >System.Type.GetType("System.String")) > >Thanks, >Christopher Lusardi > > > T Christopher,
There exist in Net the command "Add" and "Remove" column. A pity is that you can save the column, dim mycolumn as datatable.column = mydatatable.column(0) but that does not contain the values in the items. I hope this helps, Cor Show quoteHide quote "Christopher Lusardi" <clusard***@aol.com> schreef in bericht news:1147804182.844818.36580@j55g2000cwa.googlegroups.com... > On the second call to the below method body, I get the error: A column > named 'Full Name' already belongs to this Data Table. In C++, what I > would do is either set col to null on exit from the method, or only do > the assignment if col is emply. Explicitly, how would I do these 2 > things in VB? > > Dim col As DataColumn > > col = dsAdoSbs.Employees.Columns.Add("FullName", > System.Type.GetType("System.String")) > > Thanks, > Christopher Lusardi >
Frustrated trying to use "pure" VS.NET to access database properties
VB.NET Windows Service Question (Timing) How Do I Put An End Of Line Character In A TextBox Export to excel without using office automation Detect if Themes are enabled? SQLConnection Dynamically Create Timers are Run-Time VB Express - How to access query value on my form? VS2003 and VS2005 Side by Side Databinding 2 comboboxes to the same Datasource |
|||||||||||||||||||||||