Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data type of empty datarow column???
Message
De
30/07/2004 13:20:15
Max Fillmore
Essential Skills, Inc.
Lenexa, Kansas, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Data type of empty datarow column???
Divers
Thread ID:
00929703
Message ID:
00929703
Vues:
33
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform