Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data type of empty datarow column???
Message
From
30/07/2004 13:20:15
Max Fillmore
Essential Skills, Inc.
Lenexa, Kansas, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Data type of empty datarow column???
Miscellaneous
Thread ID:
00929703
Message ID:
00929703
Views:
32
Does anyone know how to obtain the datatype of a value in an empty datarow? I have an empty dataset which was created by a call to GetDataSet() that returned no rows. However there should still be schema information in the dataset. I am trying to iterate across the columnn collection to extract this information like this:

.
.
Dim dc As DataColumn
Dim dt As DataTable
Dim dr As DataRow

dt = dsMyDataSet.Tables(0)
dr = dt.NewRow

For Each dc In dt.Columns
ColumnName = dc.ColumnName.ToString()
Debug.WriteLine(ColumnName + " is " + dr(ColumnName).GetType.ToString)
Next

This code writes out "System.DBNull" for each column. I can't use Row(0) of the datatable because it doesn't exist.

Does anyone know the easy solution to this?

Thanks,
Max Fillmore
Next
Reply
Map
View

Click here to load this message in the networking platform