Thursday, February 11, 2010

How to get list of tables using ADO.Net using ODBC data connection (C#)


class Program
{
  static void Main(string[] args)
  {
  string connectionString = GetConnectionString();
  sing (SqlConnection connection = new SqlConnection(connectionString))
  {
   // Connect to the database then retrieve the schema information.
   connection.Open();
   DataTable table = connection.GetSchema("Tables");

   // Display the contents of the table.
   DisplayData(table);
   Console.WriteLine("Press any key to continue.");
   Console.ReadKey();
   }
 }

No comments:

Post a Comment

Followers

Search This Blog