I have a Database which stores user details in their. I have separated users with a Integer number like, Admin = 1, Faculty = 2 and Student = 3. Name of the column is Level.
Now I want to show the faculty details in Faculty DGV, Student details in Student DGV.
How can I do that ?
I want to use those Level number to reflect data in my DGV.
I have added the code and please, correct me if Im going wrong.
Please, consider my BAD english as Its not my mother language.
Ty codeproject.
What I have tried:
Public Sub fac_dgv()
Dim SDA As New SqlDataAdapter
Dim dbDataSet As New DataTable
Dim bSource As New BindingSource
Try
connection.Open()
Dim sql As String
sql = "SELECT id,dept,sub,name,mob,reg,mod,level from faculty"
command = New SqlCommand(sql, connection)
SDA.SelectCommand = command
SDA.Fill(dbDataSet)
bSource.DataSource = dbDataSet
connection.Close()
Me.DataGridView4.DataSource = bSource
SDA.Update(dbDataSet)
Catch ex As Exception
MsgBox(ex.Message)
Finally
connection.Dispose()
End Try
End Sub