locked
progress bar show # of Item Inserted RRS feed

  • Question

  • User-308948172 posted

    Hi,

    I have a class that Inserts multiple rows in to the database. How can I Increament the value/length of the Progress bar  base from the ExcuteNonQuery ? Like

    1/100

    25/100

    . . .

    78/100

    Thanks

    Wednesday, February 19, 2014 3:04 AM

Answers

All replies

  • User-933407369 posted

    hi ,

    How can I Increament the value/length of the Progress bar  base from the ExcuteNonQuery ?

    Without seeing your code, I did not fully understand what you mean . i would suggest you try using the way below:

     //....
          SqlConnection = new SqlConnection(constr);
           SQLConn.Open();
            myCommand = new SqlCommand(sqlCreateDBQuery, SQLConn);
            int affectcount=myCommand.ExecuteNonQuery();
            Processcount=Processcount+affectcount; //progress bar show count
        
            SQLConn.Close();
            lblProcessbar.Text = Processcount.ToString() + "/" + Total.ToString(); //progress bar total number

    Of course you can use hidden control , then call the jquery to retrieve the value from any  hidden control.

    Hope it helps you.

    Wednesday, February 19, 2014 9:23 PM
  • User-308948172 posted
    Public Class Logs
        Public Function InsertLogs() As Integer
            Dim count As Integer = 0
            Dim Process As Integer
            Using con As New SqlConnection("ConnectionString")
                //Query String
                Using cmd As New SqlCommand("Insert Query", con)
                    con.Open()
                    For i As Integer = 0 To 500
                        Process = cmd.ExecuteNonQuery
                        count += 1
                    Next
                    con.Close()
                End Using
            End Using
        End Function
    End Class

    How can I pass the count in every Insert to my Page ?

     Dim Logger As New Logs
     Logger.InsertLogs()

    Im planning to pass it to a User control which has progress bar which is wrapped by a modal popup

    Thanks

    Ron

    Wednesday, February 19, 2014 10:31 PM
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 19, 2014 10:36 PM