Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 External Development Forums - General External Development
Forum to discuss general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to General External Development | New ThreadView:  Search:  
 Author  Thread: LINQ to SQL and the SalesLogix provider
Mark Hanford
Posts: 131
 
LINQ to SQL and the SalesLogix providerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Sep 09 11:15 AM
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
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: LINQ to SQL and the SalesLogix providerYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Sep 09 11:08 AM
WHERE [t0].[ACCOUNT] = @p0[DBTYPE_STR,"Intellect"]

This is a string comparison with no ' ' around the text???
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/25/2024 5:15:15 PM