11/26/2024 4:27:14 PM
|
|
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!
Forum to discuss using the SalesLogix OLE DB Provider from external applications (including usage of built-in provider procedures). View the code of conduct for posting guidelines.
|
|
|
|
Confused about Slx Oledb provider with .net
Posted: 04 Jan 08 1:18 PM
|
Hello maybe someone can help me here.
What I am using: SalesLogix 6.2.3.1053 Visual Studio 2005 sp1 SalesLogix Oledb Provider Coding in C#
I am developing an application for my job and part of it will involve .net inserting records into our salesLogix DB. I have created a new table in slx via the Administrator with the following fields (which you may not need but for the sake of completeness here they are) PREURSTIID CONTACTID CREATEUSER CREATEDATE MODIFYUSER MODIFYDATE PRODUCTID STATUS REQUEST RESPONSE OWNER COMPLETEDDATE REQUESTEDDATE
My Connection string Provider=SLXOLEDB.1;Data Source=slx62;Initial Catalog=sdslx62;User Id=myIDassword='myPASSWORD';
My Sql Statement (note I wrote this just to test the functionality out) OleDbCommand OleCommand = new OleDbCommand("INSERT INTO MY_TABLE (ContactID,CreateUser,CreateDate,ModifyUser,ModifyDate,ProductID,Status,Request,Response,Owner,CompletedDate,RequestedDate) VALUES ('C0XXUA000086','CreateUser','" + DateTime.Now + "','User','" + DateTime.Now + "','YQA4LA100009','In Progress','Fix Something','Fix it yourself','Chris Martis','" + DateTime.Now + "','" + DateTime.Now + "')", conn);
OleCommand.ExecuteNonQuery();
When this is executed it gives be a null error for the insert of this statement because I have not included my first field PREURSTIID which is the field that I have set via the Administrator to be auto incrementing.
My connection is fine if I force some fake value and take off auto increment i can insert a record to the table. Obviously this will not sync with the slx system and create the necessary files (TEFs). My question is what is the oledb doing if it is not performing the actions? Is there an error in how I am inserting this. From all my research seems like it would just work like any other insert from a sql ADO connection (meaning no extra coding need for slx to do what it needs.) maybe i am wrong but if anyone can help me with this it will be greatly appreciated.
|
|
|
| |
| |
|
Re: Confused about Slx Oledb provider with .net
Posted: 08 Jan 08 7:55 AM
|
Steve,
I believe this is a custom table you are trying to get the ID to work in? If so, make sure the length of the ID field is 12 characters and is of type 'String'. If it is not 12 characters and not a String the SLX provider will not create an ID for it.
John G. |
|
|
|
Re: Confused about Slx Oledb provider with .net
Posted: 08 Jan 08 8:04 AM
|
I have set the PREURSTIID Field (which is my key) as a SLX Standard ID in field properties, which is a String of 12 characters when I look at the table in Saleslogix Database manager. Also I have noticed that this is the only field type where the auto increment check box is not greyed out. |
|
|
|
Re: Confused about Slx Oledb provider with .net
Posted: 08 Jan 08 8:44 AM
|
Dear John, I did what you said "If you installed the provider only on the workstation, make sure you have applied the latest service pack on that workstation" and this solved the problem. very strange problem but it makes sense when I think about. I appreciate all your help. Thanks Again.
Steve D
|
|
|
| |
|
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!
|
|
|
|
|
|
|
|