Greetings,
does anyone have any success using LINQ with the SLX Provider? I've tried a couple of simple examples, but as I'm no LINQ expert (this will be my first use of it) I can't be sure where I'm going wrong, or if it's even possible with the SLX provider.
Here's an example of what I'm doing
Dim con As New OleDb.OleDbConnection(Config.GetOption("SalesLogix_ConnectionString")) Dim db As New SalesLogixDataContext(con) Dim Accounts = From A In db.Accounts _ Where A.Account = "SomeCompanyName" _ Select A
And I've got an Account object defined in the Data Context, with just an AccountID and Account property mapping through to the ACCOUNTID and ACCOUNT of the ACCOUNT table.
The problem is getting at the results. When I do something that actually starts a bit data-access off, I get an error "Must declare the variable '@p0'. " For example:
For Each Account As Account In Accounts Debug.Print(Account.Account) Next
The ConnectionString is
Provider=SLXOLEDB.1; Data Source=servername; Initial Catalog=saleslogix_live; User ID=userid; Password=password; Extended Properties=LOG=ON; ADDRESS=servername; PORT=1706; RWPass=; Type=ODBC;
SLX Profiler shows this is being executed
---------- Client SQL --------- SELECT [t0].[ACCOUNTID] AS [AccountID], [t0].[ACCOUNT] AS [Account] FROM [ACCOUNT] AS [t0] WHERE [t0].[ACCOUNT] = @p0[DBTYPE_STR,"Intellect"] ---------- Executed SQL ---------- SELECT [t0].[ACCOUNTID] AS [AccountID], [t0].[ACCOUNT] AS [Account] FROM [ACCOUNT] AS [t0] WHERE [t0].[ACCOUNT] = @p0 |