>Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. >>
>Provider=sqloledb;Data Source=192.168.30.11;Network Library=DBMSSOCN;Initial Catalog=ctoredev;User ID=sa;Password=mypassword;
>
>> Public Shared Function GetDataView(ByVal tcSQLCMD As String) As DataView > ' Define The Command Object > Dim oCommand As New OleDbCommand() > oCommand.CommandText = tcSQLCMD > oCommand.CommandType = CommandType.Text > 'Connect to Database > oCommand.Connection = AppGlobals.oConn > Dim goView As New Data.DataView() > Try > 'Load the DataView > goView = VFPToolkit.vfpData.SqlExecute(AppGlobals.oConn, oCommand, "DataAlias") > VFPToolkit.vfpData.SqlDisConnect(AppGlobals.oConn) > Catch ex As Exception > Dim lcMess As String > lcMess = "CTX failed to return a valid Dataview" & vbCr & vbCr & ex.Message > MsgBox(lcMess, MsgBoxStyle.ApplicationModal, "CTX") > End Try > Return goView > End Function >