DataSet Merge with ignore case senstivity

0

We are working on an existing application that uses SQL Server. And now we migrated the SQL Server database from SQL Server to PostgreSQL. PostgreSQL has all the table names and their columns to lower case. But we are still using the same code which we used for SQL Server.

Now we have existing XSD related files which was generated for SQL Server database. The XSD file is having the camel case for table names and column names. Now that we are using Postgres to connect to the server, the existing SQL queries are working properly. But the following code failed due to case sensitive issue.

Method:

     public DataSet getMKey() {
        string sql = "SELECT * from MInfo where id=1";
        -- code to return dataset.
        return dataset;
     }

Code:

        DataSet ds1 = dbMgr.getMKey();

        DataSet ds2 = new DataSet();
        ds2.Tables.Add(XSDSchema.MInfo.Copy());
        ds1.Merge(ds2);

The Merge() method failed saying, System.Data.DataException HResult=0x80131920 Message=Mismatch columns in the PrimaryKey : .m_key versus .M_Key.

Can someone please suggest me a solution without changing the XSD file.

Any help is really appreciated.

c#
postgresql
xsd
dataset
asked on Stack Overflow Mar 16, 2020 by User12111111

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0