> Dim loDataProvider As Framework.Framework.Data = New Framework.Framework.Data(oApp) > > ' We have to get the primary key > loDataProvider.ParameterAdd("Numero", nRobotPrimaryKey) > If Not loDataProvider.SQLExec("SELECT Robot.NoServer,Robot.Run " + _ > "FROM Robot " + _ > "WHERE Robot.Numero=" + loDataProvider.ParameterAddSQL("Numero")) Then > CloseForm() > End If >>
> ' SQL exec > ' expC1 SQL command > Public Function SQLExec(ByVal tcSQL As String) As Boolean > Dim lcCharacter As String = "" > Dim lcCommandText As String = "" > Dim lcField As String = "" > Dim lcString As String = "" > Dim lcTable As String = "" > Dim llSuccess As Boolean = False > Dim lnCounter As Integer = 0 > Dim lnLocation As Integer = 0 > Dim lnLocation2 As Integer = 0 > Dim lnOccurence As Integer = 0 > Dim lnDateNow As Double = 0 > Dim lnDateNow2 As Double = 0 > Dim lnElapse As Double = 0 > Dim loColumn As DataColumnCollection > Dim loDataParameterSQLClient As SqlParameter = Nothing > Dim loInsertRow As Framework.InsertRow > Dim loObject As Object > > ' Reset the duration value > nDuration = 0 > > If Not InitializeDataObject(tcSQL) Then > Return False > End If >>
> Private Function InitializeDataObject(ByVal tcSql As String) As Boolean > Dim lcType As String = "" > > ' Connection object to be used when we have to open the connection manually > Dim loConnection As IDbConnection = Nothing > > Dim loDataParameterSQLClient As SqlParameter = Nothing > Dim loEnumerator As IEnumerator = oParameters.GetEnumerator > Dim loParameter As Object > > oDataAdapter = New SqlDataAdapter > oCommand = New SqlCommand > oCommand.Connection = oApp.aConnection(nConnectionString, 2) >>