nvargas
New member
Hi,
I'm building this app that has to take data from two db engines, Pervasive and MySQL, process it and write to a MySQL database.
I did the processing part and works just fine.
The problem is that I bound a datagridview to the resulting table, so, as soon as you load the form, you can see the processed data, if there is any. After the processing, I need to refresh the datagridview.
Tried tons of things and googled for it, to no avail. I created a separate button to do the refreshing, and it still doesn't work.
This is the code for my button:
Any ideas?
I'm building this app that has to take data from two db engines, Pervasive and MySQL, process it and write to a MySQL database.
I did the processing part and works just fine.
The problem is that I bound a datagridview to the resulting table, so, as soon as you load the form, you can see the processed data, if there is any. After the processing, I need to refresh the datagridview.
Tried tons of things and googled for it, to no avail. I created a separate button to do the refreshing, and it still doesn't work.
This is the code for my button:
VB.NET:
' Grabar y actualizar registros
Dim stConexion As String = "Driver={MySQL ODBC 3.51 Driver};Server=x.x.x.x;Port=3306;Database=SAIRI;User=xxxxx;Password=xxxxxx;Option=3;"
Dim dbMysql As New OdbcDataAdapter
Dim connMysql As New OdbcConnection(stConexion)
Dim commMysql As New OdbcCommand("SELECT idElemento, txtJournalBatchNumber, txtRUC, txtCedula,txtDocumentNumber, txtNumeroDocumento, txtNombre, txtSubTotal, txtRetencionIR, txtMontoIVA, datFechaEmision, txtDescripcionPago, datApplyDate, txtCuentaGasto,txtDescripcionCuenta FROM tblTemporalProcesamiento ORDER BY datApplyDate,txtNombre", connMysql)
Dim dsMysql As New DataSet
dbMysql.SelectCommand = commMysql
dbMysql.SelectCommand.CommandType = CommandType.Text
dbMysql.Fill(dsMysql)
Try
Me.progressStatusBar.Step = 50
DataGridTemporal.DataSource = dsMysql
Me.progressStatusBar.Step = 100
Catch errMySQL As System.Exception
System.Windows.Forms.MessageBox.Show(errMySQL.Message)
End Try
dsMysql = Nothing
commMysql = Nothing
connMysql = Nothing
dbMysql = Nothing
Any ideas?