Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obtain Table Field List
Message
From
29/03/2007 16:54:47
John Baird
Coatesville, Pennsylvania, United States
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01209930
Message ID:
01210070
Views:
28
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
Previous
Reply
Map
View

Click here to load this message in the networking platform