none
Cannot add a DataRelation or Constraint that has different Locale or Case Sensitive settings between its parent and child tables. RRS feed

  • Question


  • Below is the code. Same is working fine in windows2008r2 but when i run the same code in windows 2012 r2 it giving me the error..(Cannot add a DataRelation or Constraint that has different Locale or Case Sensitive settings between its parent and child tables.)

    Please help...... Is there any windows setting related to computer regional setting...

                                   

    dtTempMatTrans = dsMatTrans.Copy();

                    TransCol = new DataColumn[] { (dsMatTrans.Tables["MM_MAT_TRANS_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_MAT_TRANS_T"].Columns["DOC_ITEM_NO"]) };
                    DetailCol = new DataColumn[] { (dsMatTrans.Tables["MM_GRPRICING_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_GRPRICING_T"].Columns["DOC_ITEM_NO"]) };
                    //Added for Jobwork GRN against Store GRN -on 24/04/2008
                    if (dsMatTrans.Tables.Contains("MM_PUR_REQ_HISTORY_T") == true)
                    {
                        HistoryCol = new DataColumn[] { (dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Columns["DOC_ITEM_NO"]) };
                        dsMatTrans.Relations.Add("History", TransCol, HistoryCol);
                    }

                    ClassCol = new DataColumn[] { (dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Columns["DOC_ITEM_NO"]) };

                    FiPostingCol = new DataColumn[] { (dsMatTrans.Tables["DETAILS"].Columns["GR_DOC_NO"]), (dsMatTrans.Tables["DETAILS"].Columns["GR_ITEM_NO"]) };


                    dsMatTrans.Relations.Add("Grpricing", TransCol, DetailCol);
                    dsMatTrans.Relations.Add("Class", TransCol, ClassCol);
                    if (dsMatTrans.Tables.Contains("GL_TAXDETAILS_T") == true)
                    {
                        TaxDetailCol = new DataColumn[] { (dsMatTrans.Tables["GL_TAXDETAILS_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["GL_TAXDETAILS_T"].Columns["DOC_ITEM_NO"]) };
                        dsMatTrans.Relations.Add("TaxDetail", TransCol, TaxDetailCol);
                    }
                    dsMatTrans.Relations.Add("FIPosting", TransCol, FiPostingCol);

                    dsMatTrans.Tables["MM_MATSRNO_TRAN_T"].Clear();
                    dsMatTrans.Tables["MM_GRPRICING_T"].Clear();
                    //Added for Jobwork GRN against Store GRN - on 24/04/2008
                    if (dsMatTrans.Tables.Contains("MM_PUR_REQ_HISTORY_T") == true)
                    {
                        dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Clear();
                    }
                    dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Clear();
                    if (dsMatTrans.Tables.Contains("GL_TAXDETAILS_T") == true)
                    {
                        dsMatTrans.Tables["GL_TAXDETAILS_T"].Clear();
                    }
                    dsMatTrans.Tables["DETAILS"].Clear();
                    dsMatTrans.Tables["MM_MAT_TRANS_T"].Clear();
                    if (dsMatTrans.Tables.Contains("QM_INSPECTIONLOT_H") == true)
                    {
                        dsMatTrans.Tables["QM_INSPECTIONLOT_H"].Clear();
                    }

                    dtTempMatTrans.EnforceConstraints = false;

    • Moved by KareninstructorMVP Wednesday, August 17, 2016 9:18 AM Moved from VB.NET
    • Moved by Amy Wang_ Thursday, August 18, 2016 7:14 AM Data Platform Development related from Windows Server Migration forum
    Wednesday, August 17, 2016 8:48 AM

Answers

  • Hi Harish Waghmare,

    According to your description and related code snippet, I create a demo as below, it work fine. could you please provide a simple complete demo about the issue. We'll reproduce your issue on our side and try to find a solution to resolve it.

    DataSet dtTempMatTrans = new DataSet();
                DataSet dsMatTrans = new DataSet();
                DataColumn[] TransCol;
                DataColumn[] DetailCol;
                DataColumn[] HistoryCol;
                DataColumn[] ClassCol;
                DataColumn[] FiPostingCol;
                DataColumn[] TaxDetailCol;
    
                DataTable dt = new DataTable("MM_MAT_TRANS_T");
                DataTable dt2 = new DataTable("MM_GRPRICING_T");
                DataTable dt3 = new DataTable("MM_RECEIPT_CLASSIFICATION_T");
                DataTable dt4 = new DataTable("DETAILS");
                DataTable dt5 = new DataTable("MM_MATSRNO_TRAN_T");
    
                DataColumn dc1 = new DataColumn("DOC_NO", Type.GetType("System.String"));
                DataColumn dc2 = new DataColumn("DOC_ITEM_NO", Type.GetType("System.String"));
                dt.Columns.Add(dc1);
                dt.Columns.Add(dc2);
                dt2.Columns.Add(new DataColumn("DOC_NO", Type.GetType("System.String")));
                dt2.Columns.Add(new DataColumn("DOC_ITEM_NO", Type.GetType("System.String")));
                dt3.Columns.Add(new DataColumn("DOC_NO", Type.GetType("System.String")));
                dt3.Columns.Add(new DataColumn("DOC_ITEM_NO", Type.GetType("System.String")));
    
                DataColumn dc3 = new DataColumn("GR_DOC_NO", Type.GetType("System.String"));
                DataColumn dc4 = new DataColumn("GR_ITEM_NO", Type.GetType("System.String"));
                dt4.Columns.Add(dc3);
                dt4.Columns.Add(dc4);
    
                dsMatTrans.Tables.Add(dt);
                dsMatTrans.Tables.Add(dt2);
                dsMatTrans.Tables.Add(dt3);
                dsMatTrans.Tables.Add(dt4);
                dsMatTrans.Tables.Add(dt5);
    
                dtTempMatTrans = dsMatTrans.Copy();
               
    
                TransCol = new DataColumn[] { (dsMatTrans.Tables["MM_MAT_TRANS_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_MAT_TRANS_T"].Columns["DOC_ITEM_NO"]) };
                DetailCol = new DataColumn[] { (dsMatTrans.Tables["MM_GRPRICING_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_GRPRICING_T"].Columns["DOC_ITEM_NO"]) };
                //Added for Jobwork GRN against Store GRN -on 24/04/2008
                if (dsMatTrans.Tables.Contains("MM_PUR_REQ_HISTORY_T") == true)
                {
                    HistoryCol = new DataColumn[] { (dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Columns["DOC_ITEM_NO"]) };
                    dsMatTrans.Relations.Add("History", TransCol, HistoryCol);
                }
    
                ClassCol = new DataColumn[] { (dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Columns["DOC_ITEM_NO"]) };
    
                FiPostingCol = new DataColumn[] { (dsMatTrans.Tables["DETAILS"].Columns["GR_DOC_NO"]), (dsMatTrans.Tables["DETAILS"].Columns["GR_ITEM_NO"]) };
    
    
                dsMatTrans.Relations.Add("Grpricing", TransCol, DetailCol);
                dsMatTrans.Relations.Add("Class", TransCol, ClassCol);
                if (dsMatTrans.Tables.Contains("GL_TAXDETAILS_T") == true)
                {
                    TaxDetailCol = new DataColumn[] { (dsMatTrans.Tables["GL_TAXDETAILS_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["GL_TAXDETAILS_T"].Columns["DOC_ITEM_NO"]) };
                    dsMatTrans.Relations.Add("TaxDetail", TransCol, TaxDetailCol);
                }
                dsMatTrans.Relations.Add("FIPosting", TransCol, FiPostingCol);
    
                dsMatTrans.Tables["MM_MATSRNO_TRAN_T"].Clear();
                dsMatTrans.Tables["MM_GRPRICING_T"].Clear();
                //Added for Jobwork GRN against Store GRN - on 24/04/2008
                if (dsMatTrans.Tables.Contains("MM_PUR_REQ_HISTORY_T") == true)
                {
                    dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Clear();
                }
                dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Clear();
                if (dsMatTrans.Tables.Contains("GL_TAXDETAILS_T") == true)
                {
                    dsMatTrans.Tables["GL_TAXDETAILS_T"].Clear();
                }
                dsMatTrans.Tables["DETAILS"].Clear();
                dsMatTrans.Tables["MM_MAT_TRANS_T"].Clear();
                if (dsMatTrans.Tables.Contains("QM_INSPECTIONLOT_H") == true)
                {
                    dsMatTrans.Tables["QM_INSPECTIONLOT_H"].Clear();
                }
    
                dtTempMatTrans.EnforceConstraints = false;

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 22, 2016 6:35 AM
    Moderator

All replies

  • Hello,

    This is a forum for vb.net, not C# yet the question should be addressed in a forum for Windows server as this sounds like a setting outside of code.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, August 17, 2016 9:16 AM
  • Now i had updated properly please reply me with answer...
    Wednesday, August 17, 2016 9:54 AM
  • Hi,

    I have moved this thread into ADO.NET DataSet forum so that you would get more efficient support.

    Best Regards,

    Amy


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, August 18, 2016 7:18 AM
  • Please reply....
    Friday, August 19, 2016 4:48 AM
  • Hi Harish Waghmare,

    According to your description and related code snippet, I create a demo as below, it work fine. could you please provide a simple complete demo about the issue. We'll reproduce your issue on our side and try to find a solution to resolve it.

    DataSet dtTempMatTrans = new DataSet();
                DataSet dsMatTrans = new DataSet();
                DataColumn[] TransCol;
                DataColumn[] DetailCol;
                DataColumn[] HistoryCol;
                DataColumn[] ClassCol;
                DataColumn[] FiPostingCol;
                DataColumn[] TaxDetailCol;
    
                DataTable dt = new DataTable("MM_MAT_TRANS_T");
                DataTable dt2 = new DataTable("MM_GRPRICING_T");
                DataTable dt3 = new DataTable("MM_RECEIPT_CLASSIFICATION_T");
                DataTable dt4 = new DataTable("DETAILS");
                DataTable dt5 = new DataTable("MM_MATSRNO_TRAN_T");
    
                DataColumn dc1 = new DataColumn("DOC_NO", Type.GetType("System.String"));
                DataColumn dc2 = new DataColumn("DOC_ITEM_NO", Type.GetType("System.String"));
                dt.Columns.Add(dc1);
                dt.Columns.Add(dc2);
                dt2.Columns.Add(new DataColumn("DOC_NO", Type.GetType("System.String")));
                dt2.Columns.Add(new DataColumn("DOC_ITEM_NO", Type.GetType("System.String")));
                dt3.Columns.Add(new DataColumn("DOC_NO", Type.GetType("System.String")));
                dt3.Columns.Add(new DataColumn("DOC_ITEM_NO", Type.GetType("System.String")));
    
                DataColumn dc3 = new DataColumn("GR_DOC_NO", Type.GetType("System.String"));
                DataColumn dc4 = new DataColumn("GR_ITEM_NO", Type.GetType("System.String"));
                dt4.Columns.Add(dc3);
                dt4.Columns.Add(dc4);
    
                dsMatTrans.Tables.Add(dt);
                dsMatTrans.Tables.Add(dt2);
                dsMatTrans.Tables.Add(dt3);
                dsMatTrans.Tables.Add(dt4);
                dsMatTrans.Tables.Add(dt5);
    
                dtTempMatTrans = dsMatTrans.Copy();
               
    
                TransCol = new DataColumn[] { (dsMatTrans.Tables["MM_MAT_TRANS_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_MAT_TRANS_T"].Columns["DOC_ITEM_NO"]) };
                DetailCol = new DataColumn[] { (dsMatTrans.Tables["MM_GRPRICING_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_GRPRICING_T"].Columns["DOC_ITEM_NO"]) };
                //Added for Jobwork GRN against Store GRN -on 24/04/2008
                if (dsMatTrans.Tables.Contains("MM_PUR_REQ_HISTORY_T") == true)
                {
                    HistoryCol = new DataColumn[] { (dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Columns["DOC_ITEM_NO"]) };
                    dsMatTrans.Relations.Add("History", TransCol, HistoryCol);
                }
    
                ClassCol = new DataColumn[] { (dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Columns["DOC_ITEM_NO"]) };
    
                FiPostingCol = new DataColumn[] { (dsMatTrans.Tables["DETAILS"].Columns["GR_DOC_NO"]), (dsMatTrans.Tables["DETAILS"].Columns["GR_ITEM_NO"]) };
    
    
                dsMatTrans.Relations.Add("Grpricing", TransCol, DetailCol);
                dsMatTrans.Relations.Add("Class", TransCol, ClassCol);
                if (dsMatTrans.Tables.Contains("GL_TAXDETAILS_T") == true)
                {
                    TaxDetailCol = new DataColumn[] { (dsMatTrans.Tables["GL_TAXDETAILS_T"].Columns["DOC_NO"]), (dsMatTrans.Tables["GL_TAXDETAILS_T"].Columns["DOC_ITEM_NO"]) };
                    dsMatTrans.Relations.Add("TaxDetail", TransCol, TaxDetailCol);
                }
                dsMatTrans.Relations.Add("FIPosting", TransCol, FiPostingCol);
    
                dsMatTrans.Tables["MM_MATSRNO_TRAN_T"].Clear();
                dsMatTrans.Tables["MM_GRPRICING_T"].Clear();
                //Added for Jobwork GRN against Store GRN - on 24/04/2008
                if (dsMatTrans.Tables.Contains("MM_PUR_REQ_HISTORY_T") == true)
                {
                    dsMatTrans.Tables["MM_PUR_REQ_HISTORY_T"].Clear();
                }
                dsMatTrans.Tables["MM_RECEIPT_CLASSIFICATION_T"].Clear();
                if (dsMatTrans.Tables.Contains("GL_TAXDETAILS_T") == true)
                {
                    dsMatTrans.Tables["GL_TAXDETAILS_T"].Clear();
                }
                dsMatTrans.Tables["DETAILS"].Clear();
                dsMatTrans.Tables["MM_MAT_TRANS_T"].Clear();
                if (dsMatTrans.Tables.Contains("QM_INSPECTIONLOT_H") == true)
                {
                    dsMatTrans.Tables["QM_INSPECTIONLOT_H"].Clear();
                }
    
                dtTempMatTrans.EnforceConstraints = false;

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 22, 2016 6:35 AM
    Moderator