Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
Show data in a datagrid from Multiple tables
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Ronok Bhowmik
10y
1.2k
1
Reply
I have three tables named Names ,Departments and Students.The Names table contains columns named NameId and Name.NameId is the primary key.Here the input data for NameId is 1,2,3 and data for the Name are Ronok,Marsh and Priom accordingly. Then the table Departments contains the Column Names NameId,DepartmentId and the DepartmentName.Here DepartmentId is the primary key and NameId is the foreign key.Here the input data are 1,1,CSE ,2,2,EEE and soforth.The third table is the Students table.Here the column names are NameId and the DepartmentId.These two column are foreign key of Names and Departments table.
In the UI i have two comboboxes Named NamecomboBox and DepartmentCombobox.1stly when the form loads then the NameComboBox loads the Names from the Namestable and through the selection change event based of the namecomboBox the DepartmentComboBox populates.Now there is a Datagrid and a Button named Insert.When i press the insert button the data are inserted into the database table students as i mentioned earlier.Now i want to show the Name and the Department in the Datagrid.How can i do that.Thanks in advance.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Inner Join Query incorrect result
queries help