TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Oladotun Obileye
NA
98
19.4k
How to merge two database together to datagrid c# winsform
May 30 2019 1:49 AM
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
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
4 ts/02/012 60 10 66
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
this is my code
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);
please help thanks.
Reply
Answers (
2
)
How to maximize a windows forms on specific panel
how to retreive specific data from database in c# winsform