![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I need to present the user with a list of Tables from a database. After they have selected the table I need to present them with a list of Fields. After they select the Fields they require, I need to use an ODBCDataReader to retrieve the Data. It NEEDS to be an ODBCDataReader. I cannot find a way of retrieving the list of Tables using the ODBC.NET data provider. (Is there a way ?) I can get a list of Fields using the ODBCDataReader. Because I cannot get a list of Tables I have to use a different method eg ADOX. However the connection strings are different. Is there a way of defining a generic connection string so I can use it in ADOX to get the list of Tables and in the ODBCConnection to get the data? I want an easy way for the user to select the database they are using, it can be any ODBC compliant database, Currently I am using the Data Link Properties dialog (I believe this is for OLEDB) , but this is messy for ODBC. Is there an equivalent for ODBC?, or SQLClient? Thanks Tim |

#3
| |||
| |||
|
#4
| |||
| |||
|
|
Hi Tim, If you're using OleDbConnection class, you can use OleDbConnection.GetOleDbSchemaTable method to get the table information from the connection. However, this is not provided in ODBCConnection class. I think you can use ADOX to retrived them from the database. If anything is unclear, please feel free to reply to the post. Kevin Yu ======= "This posting is provided "AS IS" with no warranties, and confers no rights." |
#5
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |