Avatar of ITsolutionWizard
ITsolutionWizard
Flag for United States of America

asked on 

c# datatable, aspx

I have two datatable and I want to join them based on "Type" (not using linq)
The end result should have
primary John
Spouse Spouse

How can I do that in c#? Thanks

 private DataTable DtAppliantsTypeList(bool primary, bool spouse, int? totalChild)
        {
            DataTable dt = new DataTable();
            dt.Clear();
            dt.Columns.Add("Type", typeof(string));
            dt.Rows.Add("Primary");
            dt.Rows.Add("Spouse");
            return dt;
        }
        private DataTable Data()
        {
            DataTable dt = new DataTable();
            dt.Clear();
            dt.Columns.Add("Type", typeof(string));
            dt.Columns.Add("Name", typeof(string));
            dt.Rows.Add("Primary", "John");
            dt.Rows.Add("Spouse", "Mary");
            return dt;
        }

Open in new window

C#ASP.NET

Avatar of undefined
Last Comment
Dmitry G

8/22/2022 - Mon