Dim major As String = TextBox1.Text
Dim depa As String = TextBox2.Text
Dim sname As String = TextBox3.Text
Dim tbStudent As DataTable
Dim dcPrimaryKey(0) As DataColumn
tbStudent = sqlDataset.Tables("Major")
Dim c As Integer
'selecting the entire rows from dbase
myCommand = New SqlCommand("SELECT count(*) FROM Major", myConnection)
myConnection.Open()
'sqlquery1 = " select count(*) from <tablename>"
' cmd = New SqlCommand(sqlquery1, con)
c = myCommand.ExecuteScalar
Dim drSubject As System.Data.DataRow
drSubject = tbStudent.Rows.Find(major)
If c <> 0 Then
'
myCommand = New SqlCommand("SELECT MajorName,Departement,Suject_Name from Major order by MajorName", myConnection)
Dim dr As SqlDataReader = myCommand.ExecuteReader
'''''check from here
While dr.Read
tbStudent.Rows.Add()
TextBox1.Text = drSubject.Item("MajorName")
TextBox2.Text = drSubject.Item("Departement")
TextBox3.Text = drSubject.Item("Suject_Name")
End While
End If
myConnection.Dispose()
Dili1234 -2 Junior Poster
HibaPro -3 Junior Poster
Netcode 33 Veteran Poster
Maligui 1 Application Developer
Dili1234 -2 Junior Poster
Dili1234 -2 Junior Poster
Dili1234 -2 Junior Poster
Dili1234 -2 Junior Poster
Maligui 1 Application Developer
Dili1234 -2 Junior Poster
Maligui 1 Application Developer
Dili1234 -2 Junior Poster
Dili1234 -2 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.