¡Caminando hacia el éxito!

Aprende en Comunidad

Avalados por :

Solución al error de conversión de tipo al exportar e importar datos entre MySQL y SAP HANA en VB.NET 2010

  • Creado 01/03/2024
  • Modificado 01/03/2024
  • 11 Vistas
0
Cargando...

Hi Experts,

I got the error:

Unable to cast object of type 'System.Data.DataSet' to type 'System.Data.IDataReader

after running an application to export data from mysql database table and to import the data in the hana schema table. Both tables have set to have same field codes and data types. Both tables have the same table name, i.e. Billing_Data. The schema name in hana is Staging_Db. The schema name in mysql is mysqlstg_db

My application is developed using vb.net 2010. The sap hana version is 1.0 for SAP Business One Hana. I did not use SAP B1H DI API.

#Region "Common Variable"
  Private ComDset As New DataSet
#End Region
#Region "daily work"

 Private Sub trfbilldata(ByVal DBSAddOn As String, ByVal TrfNum As String, ByRef sAccumErrMsg As String)
Dim...
Dim..

Me.Cursor = Cursors.WaitCursor
        myconn = New MySqlConnection
        myconn.ConnectionString = "server=" + sDBOrigin + ";" _
        & "user id=" + sDBUserName + ";" _
        & "password=" + sDBUserPassword + ";" _
        & "database=" + sDBName + ";"


  Try
            myconn.Open()
            SQL = "SELECT * FROM BILLING_DATA where " & _
                         " coalesce(RULE1,'')='' and coalesce(TrfNum ,'') = ''"

            myCommand.Connection = myconn
            myCommand.CommandText = SQL

            myAdapter.SelectCommand = myCommand
            myAdapter.Fill(myData)

            myconn.Close()


        Catch myerror As MySqlException
            MessageBox.Show("Error: " & myerror.Message)
        Finally
            myconn.Dispose()
        End Try

        Dim filename As String
        Dim col, row As Integer
        Dim adp2 As New MySqlDataAdapter(SQL, myconn)
        Try
            ComDset.Reset()
            adp2.Fill(ComDset, "TTbl")
            If ComDset.Tables.Count <    
            
Pedro Pascal
Se unió el 07/03/2018
Pinterest
Telegram
Linkedin
Whatsapp

Sin respuestas

No hay respuestas para mostrar No hay respuestas para mostrar Se el primero en responder

contacto@primeinstitute.com

(+51) 1641 9379
(+57) 1489 6964

© 2024 Copyright. Todos los derechos reservados.

Desarrollado por Prime Institute

¡Hola! Soy Diana, asesora académica de Prime Institute, indícame en que curso estas interesado, saludos!
Hola ¿Puedo ayudarte?