Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

MySqlConnection.GetSchema for Columns (no replies)

$
0
0
To get column information with SqlClient or other providers you do:
DataTable schema = conn.GetSchema("Columns", new string[4] { conn.Database, null, "products", null });

With MySQL Connector/NET is different:
DataTable schema = conn.GetSchema("Columns", new string[4] { null, conn.Database, "products", null });

Note that the first 2 items in the array are swapped.

The difference is that MySQL Connector/NET puts the database name in the TABLE_SCHEMA column, while other providers put it in the TABLE_CATALOG column and use TABLE_SCHEMA for other information (in SQL Server TABLE_SCHEMA is typically dbo).

Is this behavior by design or a bug ?

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>