0
good pm.,.,i have a next button


Try

         lblcat.Text = ds.Tables("evaluation").Rows(cat)("QuestionCategory")

         txt1.Text = ds.Tables("evaluation").Rows(CurrentRow)("Question")

         txt2.Text = ds.Tables("evaluation").Rows(CurrentRow + 1)("Question")

         txt3.Text = ds.Tables("evaluation").Rows(CurrentRow + 2)("Question")

         txt4.Text = ds.Tables("evaluation").Rows(CurrentRow + 3)("Question")

         txt5.Text = ds.Tables("evaluation").Rows(CurrentRow + 4)("Question")



     Catch ex As Exception

     End Try

every click to the next button my category and questions change.,.,
every click i want also to save in my database

Private Sub Save_commit()

     Dim con As New OleDbConnection
     Dim cmd As New OleDbCommand
     Dim sSQL As String = String.Empty

     Try
         'get connection string declared in the Module1.vb and assing it to conn variable
         con = New OleDbConnection(Get_Constring)

         con.Open()

         cmd.Connection = con

         cmd.CommandType = CommandType.Text

         'I just use the textbox tag property to idetify if the data is new or existing.

         sSQL = "INSERT INTO evaluationresult ([Com])" & _
                 "  VALUES (?)"

         cmd.CommandText = sSQL
      cmd.Parameters.AddWithValue("@FacultyID", txtresult.Text)

         'cmd.Parameters.AddWithValue("@IDNumber", OleDbType.Numeric).Value

         'cmd.Parameters.AddWithValue("@Com", OleDbType.Numeric).Value

         ' cmd.Parameters.AddWithValue("@Know", OleDbType.Numeric).Value

         'cmd.Parameters.AddWithValue("@Teaching", OleDbType.Numeric).Value

         'cmd.Parameters.Addwithvallue("@man", OleDbType.Numeric).Value()


   'cmd.Parameters.AddWithValue("@ID", OleDbType.Numeric).Value

       cmd.ExecuteNonQuery()

     Catch ex As Exception

         MsgBox(ErrorToString)

     Finally
    con.Close()

     End Try

 End Sub

please improve

2
Contributors
1
Reply
13
Views
3 Years
Discussion Span
Last Post by Begginnerdev
0

I am sorry to sound harsh, but what are we supposed to be improving?

What part of your code are you having a problem with?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.