Good Night. Excuse me, I'd like you to help me, I'm doing a datagridview that has these columns that I put:
- ID
- Full Names
- Full Surnames
and in my database I have two tables created:
The Students table that has these fields:
- IdAlumno
- Names
- Last name
- Age
- IdCourses
- Note
The Courses table that has these Fields:
- IdCourses
- Courses
as the attached image:
but I in my datagrid want you to come out with those columns: so the records come out as a column only in the courses and below your note like this:
This is my code I would like you to help me please:
Private Sub btnMostrar_Click(sender As Object, e As EventArgs) Handles btnMostrar.Click Dim SqlDataAdapter As New SqlDataAdapter("select*from alumno", SqlConnection) Dim DataTable As New DataTable() SqlDataAdapter.Fill(DataTable) For Each DataRow As String In DataTable.Rows Dim n As Integer = (DataGridView1.Rows.Add) Next End Sub