Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create a new table with specific column from another table

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 183
    Comment on it

    Check the rows of column is either greater than zero or not
    Use function DefaultView
    Pass the parameters true for distinct, and create new string for giving columns

    if (dt1.Rows.Count > 0)
            {
             DataTable dt2 = dt1.DefaultView.ToTable(true, new string[] { "Columnname1", " Columnname2" });
            }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: