How to check if two tables have the same schema? RRS feed

  • Question

  • Hi everyone.
    I have a DataTable in memory and I want to check if its schema is the same of a table in a Access file(.mdb).
    I mean that I want to verify if the two Tables have all DataColumns equal.
    // filename, tablename and dataTable are known
    private const string CONNECTIONSTRING ="Provider=Microsoft.Jet.OLEDB.4.0;" +
      "Data Source=filename;"
    OleDbConnection connection = new OleDbConnection(CONNECTIONSTRING);
    DataTable dbSchema = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new Object[] { null, null, tableName, "TABLE" });
    How to check if dataTable and dbSchema have the same Schema without iterate on each column?

    Monday, November 9, 2009 7:42 PM


All replies