Table's definition...
-
Hello! Is there any way to get the table's definition (SQL Server 2005) in C#? Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
Hello! Is there any way to get the table's definition (SQL Server 2005) in C#? Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
Thanks for your reply, but i doubt if they are C# classes/libraries...! :)
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
Thanks for your reply, but i doubt if they are C# classes/libraries...! :)
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
Hello! Is there any way to get the table's definition (SQL Server 2005) in C#? Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
The Connection object provides you the "GetSchema()" method, which returns a DataTable filled with schema informations. You have to specifiy what information you want in parameters of the method. Example:
DataTable _indicesSchema = null; using (OleDbConnection connection = new OleDbConnection("Provider=SQLOLEDB;Password=******;Persist Security Info=True;User ID=sa;Initial Catalog=*****;Data Source=*******")) connection.Open(); _indicesSchema = connection.GetSchema("Indexes", new string[] { null, null, null, null }); connection.Close(); }
Hope was helpfullTiefe Brunnen muss man graben wenn man klares Wasser will, tiefe Wasser sind nicht still.
-
Hello! Is there any way to get the table's definition (SQL Server 2005) in C#? Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
Take a look at the GetSchema command on your connection object. It has all sorts of useful abilities for retrieving information about the database. I mention this one rather than directing you towards particular tables/stored procedures in the database because it gives you the option to discover information from lots of different database types.
Deja View - the feeling that you've seen this post before.