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 the use of .NET Extensions in SalesLogix version 7 and higher. View the code of conduct for posting guidelines.
|
|
|
|
Newbie question
Posted: 20 Sep 07 1:33 PM
|
Hi,
Can I simply use ADO.Net to insert records into a SLX database? I want to create a library that I can use either in a web or windows application that will collect contact information and insert it into the database.
What do I need installed on the "client" machine? Do I need to login to the database as a specific user? Aside from the "slx_dbids" function, are there any other functions that I need to use?
Any hints, clues or examples would be greatly appreciated.
thx...sonny |
|
|
| |
|
Re: Newbie question
Posted: 21 Sep 07 9:47 AM
|
I must be doing something wrong, I receive a 'Fail to parse SQL' exception. Can anybody tell me what it is?
Here's the test code snipet I'm using:
private void InsertAccount(string acctId) { OleDbConnection conn = null; OleDbCommand cmd = null; StringBuilder query = new StringBuilder(); try { query.Append("insert into ACCOUNT "); query.Append("(ACCOUNTID, TYPE, ACCOUNT, ADDRESSID, SHIPPINGID, SECCODEID, STATUS, ACCOUNTMANAGERID, CREATEUSER, CREATEDATE, ACCOUNT_UC) "); query.Append("values "); query.Append(string.Format("('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', {8}, '{9}', '{10})", acctId, "Patient", "Last, First", "a6UJ9A001G4Q", "a6UJ9A001G4Q", "F6UJ9A000005", "Prospective", "U6UJ9A00000N", "ADMIN", DateTime.Now, "Last, First")); conn = new OleDbConnection(slxConnection); cmd = new OleDbCommand(query.ToString(), conn); conn.Open(); MessageBox.Show(query.ToString()); cmd.ExecuteScalar(); } catch (Exception ex) { statusLabel.Text = ex.Message; MessageBox.Show(ex.ToString()); } finally { if (cmd != null) { cmd.Dispose(); } if (conn != null) { conn.Close(); } } }
thx...sonny |
|
|
|
Re: Newbie question
Posted: 21 Sep 07 10:53 AM
|
In your snipet, it looks like there are more values than fields.
Also, you are passing the date as a string the SLX Provider wants it formated "YYYYMMDD HH:MM:SS". |
|
|
|
Re: Newbie question
Posted: 23 Sep 07 9:27 AM
|
Where is the SLX OleDB Provider on the Installation CD (for 7.2)? |
|
|
|
Re: Newbie question
Posted: 24 Sep 07 6:38 AM
|
Originally posted by Phil Sim
Where is the SLX OleDB Provider on the Installation CD (for 7.2)? |
|
It's the one that says:
Client OLE DB Provider
-- rjl |
|
|
|
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!
|
|
|
|
|