Protected Sub btnOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOk.Click
imgLoading.Style.Add("visibility", "show") <-----------------------อยากให้ตรงนี้โชว์ก่อน แล้วค่อยquery และทำงานต่อ
Dim connectionString As String = "Server=xxx.xxx.x.xxx;Database=oat;User Id=sa;Password=1234;"
Dim connection As New SqlConnection(connectionString)
Try
If connection.State.Equals(ConnectionState.Closed) Then
connection.Open()
End If
Dim QueryString As New StringBuilder()
QueryString.Append("SELECT no,qty ")
QueryString.Append(" FROM order")
Dim sqlAdapter As New SqlDataAdapter(QueryString.ToString(), connection)
Dim DataTable As New DataTable("TestTable")
sqlAdapter.Fill(DataTable)
Me.Insert2MSSQL2(DataTable)
Catch ex As SqlException
Response.Write(ex.Message.ToString())
End Try
PreviewReport()
btnDetail.Style.Add("visibility", "show")
btnChart.Style.Add("visibility", "show")
End Sub