Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Obtain Table Field List
Message
De
29/03/2007 16:54:47
John Baird
Coatesville, Pennsylvanie, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01209930
Message ID:
01210070
Vues:
27
Cool. Learn something new everyday. Thanks...

Definately easier than how I would have done it.



>About two seconds ago, I found it.
>
>
>connection = new SqlConnection(MySQLConnectionString);
>connection.Open();
>DataTable test = connection.GetSchema("Columns", new string[] { null, null, "MyTable" });
>
>
>thanks though,
>
>Richard
>
>>I don't think there is a direct equivalent. If you're using datasets:
>>
>>dataset.datatable.Columns is the object array of all defined columns.
>>
>>you can test a column exists: dataset.datatable[0].Columns.Contains("ColumnName")
>>you can get type: dataset.datatable[0].Columns["ColumnName"].DataType
>>you can get col position: dataset.datatable[0].Columns["ColumnName"].Ordinal
>>
>>etc... so using the above, you could create your own sqlcolumns equivalent...
>>
>>
>>
>>Is this what you wanted?
>>
>>
>>
>>
>>>Having a little problem here:
>>>
>>>What is the .NET equivalent to SQLColumns() in VFP?
>>>
>>>Alternatively, what is the SQLClient equivalent to ODBC's SQLColumns()?
>>>
>>>TIA
>>>Richard
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform