On Jan 17, 2:42*pm, Edwin van Holland <edwinvanholl...@hotmail.com>
wrote:
Travis,
Although some types might have been registered in the .NET framework
(Perhaps MSSQL types, not sure!) I don't think all providerd will write
conversion packs. The .NET framework will probably do multiple casts and
returns the most likely result type to your datatable.
Edwin
jehugalea...@gmail.com wrote:
Hello:
Say I were to query the schema tables from a database management
system. Say I got a DataType field that held the string 'VARCHAR2'.
Now, I know that VARCHAR2 associates to System.String. However,
different DBMSs have different types and worse, even some with the
same type turn out to be different .NET types.
I would like DMBS-independent way of getting a .NET type from a
DataType string. Now, I have existing code that gets the .NET type by
using a DataTable. Somehow DataTables have the .NET types. How is this
done? Do the providers implement the conversion themselves?
Any insight or solutions would be greatly appreciated!
Thanks,
Travis- Hide quoted text -
- Show quoted text -
My biggest problem is that I am not given a column in a table, so that
I could query it. For instance, I am some times given a stored
procedure definition and want to know what the parameter types are.
I can query the metadata table, but it will always return a string
that represents that type on the DBMS. I don't want to have a switch
statement with all the types on the database to map to a .NET type.
Even more, I think calling FillSchema or something similar is overkill
for something that may be called many, many times.
My overall goal to provide the developers here code that would
generate the C# code that would execute a stored procedure. I have
written code that will access the meta data tables and figure out
information about the stored procedures. Right now, my library
supports MySQL, Oracle, MSSQL, PostgreSQL and Access.
With a large number of supported databases and the potential for more,
manually entering in type conversion is buggy and tedious.
I was hoping there was a tool available or a trick to getting the
information.
Thanks for your reply.