Net packets out of order: received[0], expected[2]

Net packets out of order: received[0], expected[2]

Postby muzamilw » Mon 14 Mar 2005 13:56

Hi,

I have upgraded from version 2.30 to 2.74 version due to non compatibility with MYSQL4.1.

but now in this latest release i am getting this exception.
System.Exception: CoreLab Exception ---> Net packets out of order: received[0], expected[2]

though in the change history it is mentioned that this bug is fixed, still I'm constantly getting this error.

any workarounds.

Thanks
Muzzammil
muzamilw
 

Postby Serious » Mon 14 Mar 2005 14:20

Please send us small test project if possible to reproduce the problem; it is desirable to use 'test' schema objects, otherwise include definition of your own database objects. Do not use third party components.

If it is impossible for you to create test project please send us a piece of your code where the error occurs.
Serious
 

Code sample

Postby muzamilw » Mon 14 Mar 2005 15:45

Hi Oleg,

The problem is that I have a very complex product with differnt layers of code.

In the DAL layer, I am calling multiple functions several times for which always use FILL method of DATASET.

Following is the helper class which we have in DAL, to simply the function calling, based on MS Data access Block functionality. I know CoreLab also has a similar kind of Class available , but we have modified the functions to our need.

I am using the ExecuteRow function of this class, which is called multiple times, and after 5-6 iteration, this exception is thrown.

Generally I get this error when multiple Read Queiries are made, At this point the Application is single threaded. and as you can see connection is closed within these function calls.

Some times of I dont get this error, The application just simply hangs and nothing happens, no exceptions.

Looking for Reply.

Code: Select all
Option Strict On

Imports System
Imports System.Configuration
Imports System.Collections
Imports CoreLab.MySql



Public Class MYSQLHelper

    'Database connection strings
    'Public Shared ReadOnly CONN_STRING As String = ConfigurationSettings.AppSettings("MySQLConnString1")

    '// Hashtable to store cached parameters
    'Private parmCache As Hashtable = Hashtable.Synchronized(New Hashtable)

    '///
    '/// Execute a SqlCommand (that returns no resultset) against the database specified in the connection string
    '/// using the provided parameters.
    '///

    '///
    '/// e.g.: 
    '///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
    '///

    '/// a valid connection string for a SqlConnection
    '/// the CommandType (stored procedure, text, etc.)
    '/// the stored procedure name or T-SQL command
    '/// an array of SqlParamters used to execute the command
    '/// an int representing the number of rows affected by the command

    Public Shared Function ExecuteNonQuery(ByVal connString As String, ByVal cmdType As CommandType, ByVal cmdText As String, ByVal cmdParms As MySqlParameter()) As Integer

        Dim cmd As MySqlCommand = New MySqlCommand
        Dim conn As MySqlConnection = New MySqlConnection(connString)

        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            Dim val As Integer = cmd.ExecuteNonQuery()
            cmd.Parameters.Clear()
            Return val
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExecuteNonQuery Function", exx)
        Finally                'Add this for finally closing the connection and destroying the command
            conn.Close()
            cmd = Nothing
            cmdParms = Nothing
        End Try
    End Function

    '///
    '/// Execute a SqlCommand (that returns no resultset) against an existing database connection
    '/// using the provided parameters.
    '///

    '///
    '/// e.g.: 
    '///  int result = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
    '///

    '/// an existing database connection
    '/// the CommandType (stored procedure, text, etc.)
    '/// the stored procedure name or T-SQL command
    '/// an array of SqlParamters used to execute the command
    '/// an int representing the number of rows affected by the command

    Public Shared Function ExecuteNonQuery(ByRef conn As MySqlConnection, ByVal cmdType As CommandType, ByVal cmdText As String, ByVal cmdParms As MySqlParameter()) As Integer
        Dim cmd As MySqlCommand = New MySqlCommand
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            Dim parm As MySqlParameter
            'For Each parm In cmdParms
            '    cmd.Parameters.Add(parm)
            'Next
            Dim val As Integer = cmd.ExecuteNonQuery()
            cmd.Parameters.Clear()
            Return val
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw exx
        Finally
            cmd = Nothing
        End Try
    End Function

    '   ///
    '/// Execute a SqlCommand that returns a resultset against the database specified in the connection string
    '/// using the provided parameters.
    '///

    '///
    ''/// e.g.: 
    '///  SqlDataReader r = ExecuteReader(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
    '///

    '/// a valid connection string for a SqlConnection
    '/// the CommandType (stored procedure, text, etc.)
    '/// the stored procedure name or T-SQL command
    '/// an array of SqlParamters used to execute the command
    '/// A SqlDataReader containing the results

    Public Shared Function ExecuteReader(ByRef conn As CoreLab.MySql.MySqlConnection, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As CoreLab.MySql.MySqlParameter() = Nothing) As CoreLab.MySql.MySqlDataReader
        Dim cmd As MySqlCommand = New MySqlCommand
        'Dim conn As OleDbConnection = New OleDbConnection(connString)
        ' we use a try/catch here because if the method throws an exception we want to
        ' close the connection throw ex code, because no datareader will exist, hence the
        ' commandBehaviour.CloseConnection will not work
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            Dim rdr As MySqlDataReader = cmd.ExecuteReader()
            'cmd.Parameters.Clear()
            Return rdr
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw exx
        Finally
            cmd = Nothing
        End Try
    End Function

    Public Shared Function ExecuteTable(ByVal connString As String, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataTable

        Dim cmd As MySqlCommand = New MySqlCommand
        Dim conn As MySqlConnection = New MySqlConnection(connString)
        Dim oDataAdapter As New MySqlDataAdapter
        Dim oDataTable As New DataTable
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            'cmd.Parameters = cmdParms
            oDataAdapter.SelectCommand = cmd
            oDataAdapter.Fill(oDataTable)
            cmd.Parameters.Clear()
            Return oDataTable
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExecuteTable Exception :", exx)
        Finally
            conn.Close()
            cmd = Nothing
            oDataAdapter = Nothing
        End Try
    End Function

    Public Shared Function ExecuteTable(ByRef oConnection As MySqlConnection, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataTable

        Dim cmd As MySqlCommand = New MySqlCommand
        Dim oDataAdapter As New MySqlDataAdapter
        Dim oDataTable As New DataTable
        Try
            PrepareCommand(cmd, oConnection, cmdType, cmdText, cmdParms)
            oDataAdapter.SelectCommand = cmd
            oDataAdapter.Fill(oDataTable)
            cmd.Parameters.Clear()
            Return oDataTable
        Catch ex As Exception
            Throw New Exception("ExecuteTable", ex)
        Finally
            cmd.Dispose()
            oDataAdapter.Dispose()
            oDataTable.Dispose()
        End Try
    End Function

    Public Shared Function ExecuteDataSet(ByVal connString As String, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataSet
        Dim cmd As MySqlCommand = New MySqlCommand
        Dim conn As MySqlConnection = New MySqlConnection(connString)
        Dim oDataAdapter As New MySqlDataAdapter
        Dim oDataSet As New DataSet
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            oDataAdapter.SelectCommand = cmd
            'cmd.Connection = conn
            oDataAdapter.Fill(oDataSet)
            cmd.Parameters.Clear()
            Return oDataSet
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExecuteDataSet", exx)
        Finally
            conn.Close()
            cmd = Nothing
            oDataAdapter = Nothing
        End Try
    End Function

    Public Shared Function ExecuteRow(ByVal connString As String, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataRow
        Dim cmd As MySqlCommand = New MySqlCommand
        Dim conn As MySqlConnection = New MySqlConnection(connString)
        Dim oDataAdapter As New MySqlDataAdapter
        Dim oDataRow As DataRow
        Dim oDataTable As New DataTable
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            oDataAdapter.SelectCommand = cmd
            oDataAdapter.Fill(oDataTable)
            cmd.Parameters.Clear()
            If oDataTable.Rows.Count = 0 Then
                Return Nothing
            Else
                Dim oRow As DataRow = oDataTable.Rows(0)
                Return oRow
            End If
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExecuteRow", exx)
        Finally
            conn.Close()
            oDataTable = Nothing
            cmd = Nothing
            oDataAdapter = Nothing
        End Try
    End Function


    Public Shared Function ExecuteRow(ByRef oConnection As MySqlConnection, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataRow
        Dim cmd As MySqlCommand = New MySqlCommand
        Dim conn As MySqlConnection = oConnection
        Dim oDataAdapter As New MySqlDataAdapter
        Dim oDataRow As DataRow
        Dim oDataTable As New DataTable
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            oDataAdapter.SelectCommand = cmd
            oDataAdapter.Fill(oDataTable)
            cmd.Parameters.Clear()
            If oDataTable.Rows.Count = 0 Then
                Return Nothing
            Else
                Dim oRow As DataRow = oDataTable.Rows(0)
                Return oRow
            End If
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExeculateScalar", exx)
        Finally
            oDataTable = Nothing
            cmd = Nothing
            oDataAdapter = Nothing
        End Try
    End Function

    '///
    '/// Execute a SqlCommand that returns the first column of the first record against the database specified in the connection string
    '/// using the provided parameters.
    '///

    '///
    '/// e.g.: 
    '///  Object obj = ExecuteScalar(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
    '///

    '/// a valid connection string for a SqlConnection
    '/// the CommandType (stored procedure, text, etc.)
    '/// the stored procedure name or T-SQL command
    '/// an array of SqlParamters used to execute the command
    '/// An object that should be converted to the expected type using Convert.To{Type}

    Public Shared Function ExecuteScalar(ByVal connString As String, ByVal cmdType As CommandType, ByVal cmdText As String, ByVal cmdParms As MySqlParameter()) As Object
        Dim cmd As MySqlCommand = New MySqlCommand
        Dim conn As MySqlConnection = New MySqlConnection(connString)
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            Dim val As Object = cmd.ExecuteScalar()

            cmd.Parameters.Clear()
            Return val
        Catch ex As MySqlException

            Throw New Exception("Corelab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExeculateScalar", exx)
        Finally
            conn.Close()
            conn = Nothing
            cmd = Nothing
        End Try
    End Function


    '///
    '/// Execute a SqlCommand that returns the first column of the first record against an existing database connection
    '/// using the provided parameters.
    '///

    '///
    '/// e.g.: 
    '///  Object obj = ExecuteScalar(connString, CommandType.StoredProcedure, "PublishOrders", new SqlParameter("@prodid", 24));
    '///

    '/// an existing database connection
    '/// the CommandType (stored procedure, text, etc.)
    '/// the stored procedure name or T-SQL command
    '/// an array of SqlParamters used to execute the command
    '/// An object that should be converted to the expected type using Convert.To{Type}

    Public Shared Function ExecuteScalar(ByRef conn As MySqlConnection, ByVal cmdType As CommandType, ByVal cmdText As String, ByVal cmdParms As MySqlParameter()) As Object

        Dim cmd As MySqlCommand = New MySqlCommand
        Try
            PrepareCommand(cmd, conn, cmdType, cmdText, cmdParms)
            Dim val As Object = cmd.ExecuteScalar()
            cmd.Parameters.Clear()
            Return val
        Catch ex As MySqlException
            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExeculateScalar", exx)
        Finally
            cmd = Nothing
        End Try
    End Function

    '///
    '/// add parameter array to the cache
    '///

    '/// Key to the parameter cache
    '/// an array of SqlParamters to be cached

    'Public Function CacheParameters(ByVal cacheKey As String, ByVal cmdParms As SqlParameter())
    '    parmCache(cacheKey) = cmdParms
    'End Function

    '///
    '/// Retrieve cached parameters
    '///

    '/// key used to lookup parameters
    '/// Cached SqlParamters array

    'Public Function GetCachedParameters(ByVal cacheKey As String) As OleDbParameter()
    '    Dim cachedParms As OleDbParameter() = parmCache(cacheKey)
    '    If IsNothing(cachedParms) Then
    '        Return Nothing
    '    End If

    '    Dim clonedParms() As OleDbParameter = New OleDbParameter("abc", cachedParms.Length)
    '    Dim i As Integer
    '    Dim j As Integer = cachedParms.Length
    '    For i = 0 To j < 1
    '      clonedParms(i) = (SqlParameter)((ICloneable)cachedParms(i)).Clone();
    '        Return clonedParms
    '    Next


    '///
    '/// Prepare a command for execution
    '///

    '/// SqlCommand object
    '/// SqlConnection object
    '/// SqlTransaction object
    '/// Cmd type e.g. stored procedure or text
    '/// Command text, e.g. Select * from Products
    '/// SqlParameters to use in the command

    Public Shared Function PrepareCommand(ByRef cmd As MySqlCommand, ByRef conn As MySqlConnection, ByRef cmdType As CommandType, ByRef cmdText As String, ByRef cmdParms As MySqlParameter()) As Boolean
        If Not conn.State = ConnectionState.Open Then
            conn.Open()
        End If
        Try
            cmd.Connection = conn
            cmd.CommandText = cmdText
            cmd.Parameters.Clear()
            cmd.ParameterCheck = True
            cmd.CommandType = cmdType
            If Not (IsNothing(cmdParms)) Then
                Dim parm As MySqlParameter
                For Each parm In cmdParms
                    cmd.Parameters.Add(parm)
                Next
            End If
        Catch ex As MySqlException

            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("PrepareCommand : ", exx)
        End Try
    End Function


    Public Shared Function ExcuteAdapter(ByVal connString As String, ByVal oTable As DataTable, ByVal cmdText As String, Optional ByRef lngMaxID As Long = 0) As Boolean

        Dim conn As MySqlConnection
        Dim oDataAdapter As New MySqlDataAdapter
        Dim oSqlCmd As New MySqlCommand
        Dim oCmdBuilder As MySqlCommandBuilder
        Try
            conn = New MySqlConnection(connString)
            If Not conn.State = ConnectionState.Open Then
                conn.Open()
            End If

            oSqlCmd.Connection = conn
            oSqlCmd.CommandText = cmdText
            oSqlCmd.CommandType = CommandType.Text
            oDataAdapter.SelectCommand = oSqlCmd
            oCmdBuilder = New MySqlCommandBuilder(oDataAdapter)
            oCmdBuilder.GetUpdateCommand()
            oCmdBuilder.GetInsertCommand()
            oCmdBuilder.GetDeleteCommand()
            oDataAdapter.Update(oTable)
            oDataAdapter.SelectCommand = New MySqlCommand("SELECT @@IDENTITY", conn)
            lngMaxID = CType(oDataAdapter.SelectCommand.ExecuteScalar(), Long)

        Catch ex As MySqlException
            Throw New Exception("CoreLab Exception ", ex)
        Catch exx As Exception
            Throw New Exception("ExeculateAdapter", exx)
        Finally
            If conn.State = ConnectionState.Open Then conn.Close()
            oSqlCmd = Nothing
            oDataAdapter = Nothing
            oCmdBuilder = Nothing
        End Try

    End Function

    '''
    ''' return table Schema
    '''

    '''
    '''
    '''
    '''
    Public Shared Function FillSchema(ByVal connString As String, ByVal cmdText As String, ByVal strTableName As String) As DataTable

        Dim conn As MySqlConnection
        Dim oDataAdapter As MySqlDataAdapter
        Dim oCmdBuilder As MySqlCommandBuilder
        Dim oDataTable As New DataTable

        Try
            conn = New MySqlConnection(connString)
            If Not conn.State = ConnectionState.Open Then
                conn.Open()
            End If
            oDataAdapter = New MySqlDataAdapter(cmdText, conn)
            oCmdBuilder = New MySqlCommandBuilder(oDataAdapter)
            oDataAdapter.FillSchema(oDataTable, SchemaType.Source)
            oDataTable.TableName = strTableName
            Return oDataTable
        Catch ex As Exception
            Throw ex
        End Try


    End Function

End Class
muzamilw
 

Postby Serious » Mon 14 Mar 2005 16:48

Try this code:
Code: Select all
  Public Shared Function ExecuteRow(ByVal connString As String, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataRow

    Dim con As MySqlConnection = New MySqlConnection(connString)
    Dim cmd As MySqlCommand = New MySqlCommand(cmdText, con)
    cmd.CommandType = cmdType
    Dim table As MySqlDataTable = New MySqlDataTable(cmd, con)
    con.Open()
    Try
      table.Active = True
      If table.Rows.Count = 0 Then
        Return Nothing
      Else
        Dim oRow As DataRow = table.Rows(0)
        Return oRow
      End If
    Catch ex As MySqlException
      Throw New Exception("CoreLab Exception ", ex)
    Catch exx As Exception
      Throw New Exception("ExecuteRow", exx)
    Finally
      table.Active = False
      con.Close()
    End Try
  End Function


  Public Shared Function ExecuteRow(ByRef oConnection As MySqlConnection, ByVal cmdType As CommandType, ByVal cmdText As String, Optional ByVal cmdParms As MySqlParameter() = Nothing) As DataRow
   
    Dim cmd As MySqlCommand = New MySqlCommand(cmdText, oConnection)
    cmd.CommandType = cmdType
    Dim table As MySqlDataTable = New MySqlDataTable(cmd, oConnection)
    oConnection.Open()
    Try
      table.Active = True
      If table.Rows.Count = 0 Then
        Return Nothing
      Else
        Dim oRow As DataRow = table.Rows(0)
        Return oRow
      End If
    Catch ex As MySqlException
      Throw New Exception("CoreLab Exception ", ex)
    Catch exx As Exception
      Throw New Exception("ExecuteRow", exx)
    Finally
      table.Active = False
      oConnection.Close()
    End Try
  End Function
If it is possible please send us small example on using ExecuteRow function.
Serious
 

executerow sample and situation..

Postby muzamilw » Tue 15 Mar 2005 09:02

Hi oleg,

I am pasting below the function which calls the executeRow function of Helper Class and initiates the Object and returns it.

Net Packet Error occurs in this function mostly.

At the moment we are using System.Datatable across our all tiers to move data in few scenerios. And Corelab is only used in DAL layer. Since our application is not Database specific,we cannot add references to Corelab in our UI and other layers. It seems that by using MySQLDataTable we will be restricted to only one database. Please suggest some other workaround.

Code: Select all
        Public Function getStockByStockID(ByVal StockID As Integer) As StockItem Implements IDAL.Inventory.IInventory.getStockByStockID
            Dim oRow As DataRow
            Dim parm(0) As MySqlParameter

            Try
                parm(0) = New MySqlParameter(PARM_ITEMID, MySqlType.Int)
                parm(0).Value = StockID
                oRow = MYSQLHelper.ExecuteRow(Me._GlobalData.AppSettings.ConnectionString, CommandType.Text, MYSQL_GET_STOCK_BY_STOCK_ID, parm)

                ' CInt(IIf(oDataRow.Item("SupplierID") Is DBNull.Value, 0, oDataRow.Item("SupplierID")))
                ' CStr(IIf(oDataRow.Item("FirstName") Is DBNull.Value, String.Empty, oDataRow.Item("FirstName")))
                Dim oStockItem As New StockItem

                If Not oRow Is Nothing Then
                    oStockItem.ItemID = CInt(oRow.Item("ItemID"))
                    oStockItem.ItemCode = CStr(oRow.Item("ItemCode"))
                    oStockItem.ItemName = CStr(oRow.Item("ItemName"))
                    oStockItem.ItemWeight = CInt(oRow.Item("ItemWeight"))
                    oStockItem.ItemColor = CStr(oRow.Item("ItemColour"))
                    'oStockItem.ItemMeasure = CInt(oRow.Item("ItemMeasure"))
                    oStockItem.ItemSizeCustom = CBool(oRow.Item("ItemSizeCustom"))
                    oStockItem.ItemSizeID = CInt(oRow.Item("ItemSizeID"))
                    oStockItem.ItemSizeHeight = CDbl(oRow.Item("ItemSizeHeight"))
                    oStockItem.ItemSizeWidth = CDbl(oRow.Item("ItemSizeWidth"))
                    oStockItem.ItemSizeDim = CInt(oRow.Item("ItemSizeDim"))
                    oStockItem.ItemUnitSize = CInt(oRow.Item("ItemUnitSize"))
                    oStockItem.SupplierID = CInt(oRow.Item("SupplierID"))
                    oStockItem.CostPrice = CDbl(oRow.Item("CostPrice"))
                    oStockItem.CategoryID = CInt(oRow.Item("CategoryID"))
                    oStockItem.SubCategoryID = CInt(oRow.Item("SubCategoryID"))
                    oStockItem.LastModifiedDateTime = CDate(oRow.Item("LastModifiedDateTime"))
                    oStockItem.LastModifiedBy = CInt(oRow.Item("LastModifiedBy"))
                    oStockItem.StockLevel = CInt(oRow.Item("StockLevel"))
                    oStockItem.PackageQty = CDbl(oRow.Item("PackageQty"))
                    oStockItem.Status = CInt(oRow.Item("Status"))
                    oStockItem.ReOrderLevel = CDbl(oRow.Item("ReOrderLevel"))
                    oStockItem.StockLocation = CStr(oRow.Item("StockLocation"))
                    oStockItem.ItemCoatedType = CInt(oRow.Item("ItemCoatedType"))
                    oStockItem.ItemCoated = CBool(oRow.Item("ItemCoated"))
                    oStockItem.ItemExposure = CBool(oRow.Item("ItemExposure"))
                    oStockItem.ItemExposureTime = CInt(oRow.Item("ItemExposureTime"))
                    oStockItem.ItemProcessingCharge = CDbl(oRow.Item("ItemProcessingCharge"))
                    oStockItem.ItemType = CStr(oRow.Item("ItemType"))
                    oStockItem.StockCreated = CDate(oRow.Item("StockCreated"))
                    oStockItem.PerQtyRate = CDbl(oRow.Item("PerQtyRate"))
                    oStockItem.PerQtyQty = CDbl(oRow.Item("PerQtyQty"))
                    oStockItem.ItemDescription = CStr(oRow.Item("ItemDescription"))
                    oStockItem.LockedBy = CInt(oRow.Item("LockedBy"))
                    oStockItem.ReorderQty = CInt(oRow.Item("ReorderQty"))
                    oStockItem.LastOrderQty = CInt(oRow.Item("LastOrderQty"))
                    'oStockItem.LastOrderDate = CDate(IIf(oRow.Item("LastOrderDate") Is DBNull.Value, DBNull.Value, oRow.Item("LastOrderDate")))
                    oStockItem.LastOrderDate = CDate(oRow.Item("LastOrderDate"))
                    oStockItem.inStock = CDbl(oRow.Item("inStock"))
                    oStockItem.onOrder = CDbl(oRow.Item("onOrder"))
                    oStockItem.Allocated = CDbl(oRow.Item("Allocated"))
                    oStockItem.TaxID = CInt(oRow.Item("TaxID"))
                    oStockItem.UnitRate = CDbl(oRow.Item("unitRate"))
                    oStockItem.ItemSizeSelectedUnit = CInt(oRow.Item("ItemSizeSelectedUnit"))
                    oStockItem.ItemWeightSelectedUnit = CInt(oRow.Item("ItemWeightSelectedUnit"))
                    oStockItem.FlagID = CInt(oRow.Item("flagID"))

                    oStockItem.InkAbsorption = CDbl(oRow.Item("InkAbsorption"))
                    oStockItem.WashupCounter = CInt(oRow.Item("WashupCounter"))
                    oStockItem.InkYield = CDbl(oRow.Item("InkYield"))
                    oStockItem.PaperBasisAreaID = CInt(oRow.Item("PaperBasicAreaID"))
                    oStockItem.PaperType = CInt(oRow.Item("PaperType"))
                    oStockItem.PerQtyType = CInt(oRow.Item("PerQtyType"))
                    oStockItem.RollWidth = CDbl(oRow.Item("RollWidth"))
                    oStockItem.RollLength = CDbl(oRow.Item("RollLength"))
                    oStockItem.RollStandards = CInt(oRow.Item("RollStandards"))
                    oStockItem.InkYieldStandards = CInt(oRow.Item("InkYieldStandards"))
                    oStockItem.PerQtyPrice = CDbl(oRow.Item("PerQtyPrice"))
                    oStockItem.PackPrice = CDbl(oRow.Item("PackPrice"))

                    If IsDBNull(oRow.Item("SupplierName")) = False Then
                        oStockItem.SupplierName = CStr(oRow.Item("SupplierName"))
                    End If
                    Return oStockItem
                End If
            Catch ex As Exception
                Throw New Exception("getStockByStockID_inDAL", ex)
            End Try
        End Function
muzamilw
 

server version

Postby muzamilw » Tue 15 Mar 2005 12:02

By the way

I am using 4.0.15 Version of MySQL, installed on Windows 2003 Server.

There used to be no issues using the 2.3.0 verson of the SQL Direct drivers. except when we connect to Server 4.1 we get ";" syntax error.

so I thought in order to support 4.1 version of server lets upgrade the driver itself, but new problems with it ..

waiting for your response
Muzzammil
muzamilw
 

Postby Serious » Fri 18 Mar 2005 13:10

Please send us definition of your database object (create table sql query) and query text contained in variable MYSQL_GET_STOCK_BY_STOCK_ID.
Serious
 


Return to dotConnect for MySQL