Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings, i'm using DataTable to transfer through WCF channel.
I know, thats a bad solution, however it's a necessary by system design.

So, i've encountered a problem...
In this code, as you can see, i'm populating datatable with dataadapter.

C#
using (var session = DatabaseManager.SessionFactory.OpenSession())
{
    using (var conn = session.Connection as MySqlConnection)
    {
        var adapter = new MySqlDataAdapter(string.Format("SELECT * FROM {0}", dt.TableName), conn);
        adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
        adapter.Fill(dt);
        dt.AcceptChanges();
    }
}


When i checking DataTable constraints property, it's filled.

BUT! When datatable comes to client side, constraints vanished. AcceptChanges not working here for me...
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900