Hi,
I need to show a description of an operation in a label while an SQL DTS and stored proc are launched. The SQL part works fine, but my label do not show the text. In VB6 this problem can be worked around by using REFRESH of DOEVENTS. How can I reach the same in .NET. Below is part of the code to give you an example:
Protected Sub ProcessStatFile()
Dim CnnCol As ConnectionStringSettingsCollection
Dim sCnn As String
Dim SQLcnn As New SqlClient.SqlConnection
Dim SQLcmd As SqlClient.SqlCommand
If Session("LNG") = "1" Then
lblMsg.Text = "Validation des employés"
Else
lblMsg.Text = "Employees Validation"
End If
'Get the ODBC configuration from the Web.Config
CnnCol = ConfigurationManager.ConnectionStrings
sCnn = CnnCol.Item("IntranetConnection").ToString
SQLcnn.ConnectionString = sCnn
SQLcnn.Open()
SQLcmd = New SqlClient.SqlCommand
SQLcmd.CommandText = "sp_StandardizeImportTable"
SQLcmd.CommandType = CommandType.StoredProcedure
SQLcmd.Connection = SQLcnn
SQLcmd.ExecuteNonQuery()
If Session("LNG") = "1" Then
lblMsg.Text = "Mise à jour des statistiques"
Else
lblMsg.Text = "Update statistics"
End If
SQLcmd = New SqlClient.SqlCommand
SQLcmd.CommandText = "sp_UpdateEmployeeStats"
SQLcmd.CommandType = CommandType.StoredProcedure
SQLcmd.Connection = SQLcnn
SQLcmd.ExecuteNonQuery()
SQLcmd = Nothing
SQLcnn = Nothing
If Session("LNG") = "1" Then
lblMsg.Text = "Opération terminée!"
Else
lblMsg.Text = "Operation completed!"
End If
End Sub
Only the last message (Operation Completed) is shown, probably because the process has been released...
Thanks for your help.
Mal'chik![[bigglasses] [bigglasses] [bigglasses]](/data/assets/smilies/bigglasses.gif)
I need to show a description of an operation in a label while an SQL DTS and stored proc are launched. The SQL part works fine, but my label do not show the text. In VB6 this problem can be worked around by using REFRESH of DOEVENTS. How can I reach the same in .NET. Below is part of the code to give you an example:
Protected Sub ProcessStatFile()
Dim CnnCol As ConnectionStringSettingsCollection
Dim sCnn As String
Dim SQLcnn As New SqlClient.SqlConnection
Dim SQLcmd As SqlClient.SqlCommand
If Session("LNG") = "1" Then
lblMsg.Text = "Validation des employés"
Else
lblMsg.Text = "Employees Validation"
End If
'Get the ODBC configuration from the Web.Config
CnnCol = ConfigurationManager.ConnectionStrings
sCnn = CnnCol.Item("IntranetConnection").ToString
SQLcnn.ConnectionString = sCnn
SQLcnn.Open()
SQLcmd = New SqlClient.SqlCommand
SQLcmd.CommandText = "sp_StandardizeImportTable"
SQLcmd.CommandType = CommandType.StoredProcedure
SQLcmd.Connection = SQLcnn
SQLcmd.ExecuteNonQuery()
If Session("LNG") = "1" Then
lblMsg.Text = "Mise à jour des statistiques"
Else
lblMsg.Text = "Update statistics"
End If
SQLcmd = New SqlClient.SqlCommand
SQLcmd.CommandText = "sp_UpdateEmployeeStats"
SQLcmd.CommandType = CommandType.StoredProcedure
SQLcmd.Connection = SQLcnn
SQLcmd.ExecuteNonQuery()
SQLcmd = Nothing
SQLcnn = Nothing
If Session("LNG") = "1" Then
lblMsg.Text = "Opération terminée!"
Else
lblMsg.Text = "Operation completed!"
End If
End Sub
Only the last message (Operation Completed) is shown, probably because the process has been released...
Thanks for your help.
Mal'chik
![[bigglasses] [bigglasses] [bigglasses]](/data/assets/smilies/bigglasses.gif)