Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with error Getting Data from SQL
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Visual FoxPro Toolkit for .NET
Title:
Help with error Getting Data from SQL
Miscellaneous
Thread ID:
00804911
Message ID:
00804911
Views:
44
I'm sure i'm missing just something little, but I can't get this function to work.

Code from Button Click
        'Establish a connection and a command 
        Dim lcConnectionString As String
        Dim lcSQL As String
        Dim oConn As OleDb.OleDbConnection
        Dim goView As Data.DataView
        Dim oCommand As New OleDb.OleDbCommand

        'Get the connection string and sql statement
        lcConnectionString = "Provider=SQLOLEDB;SERVER=(local);database=CTORE;UID=ctore;pwd=cqi$$"

        oCommand.CommandText = "smsg_Get_SendToSystems"
        oCommand.CommandType = CommandType.StoredProcedure

        'Connect to the Database, execute the query and disconnect
        oConn = SqlConnect(lcConnectionString)
        oCommand.Connection = oConn

        goView = SqlExecute(oConn, oCommand, "smsgList")
        SqlDisConnect(oConn)
        'Select the default cursor
        VFPToolkit.vfpData.Select(goView)
        Browse()
Error Message:
An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll

Additional information: Fill: SelectCommand.Connection property has not been initialized.
Reply
Map
View

Click here to load this message in the networking platform