Как объединить две таблицы в базе данных в C# windowsform
Good day everyone please i am working on c# windowsform applicaton for loan i want to join two database base on a particular column. i have two database(employement,loanform) please i want to join the two of them to a new table so there will not be duplicate colums) database employementform(1st database) id employementnumber fullname age 1 ts/02/001 adedoyin 40 2 ts/02/003 chisom 25 3 ts/02/012 femi 44 4 ts/02/022 James 33 database loanform(2nd database) id employementnumber amountofloan percent totalamount 1 ts/02/003 10000 10 100000 2 ts/02/003 2500 10 2750 3 ts/02/01 1200 10 1320 i want to join them on a new database to show on a datagridview and i want it to be like this: database join id employementnumber fullname age amountofloan percent totalamount 1 ts/02/003 adedoyin 40 10000 10 100000 2 ts/02/003 adedoyin 40 2500 10 2750 3 ts/02/01 chisom 25 1200 10 1320
Что я уже пробовал:
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\odt\Documents\Loanapp.mdf;Integrated Security=True;Connect Timeout=30"); DataTable dt = new DataTable(); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "select * from loanform,Registrationform"; cmd.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(cmd);