I’ve had an article on slxdeveloper.com for a while now that shows how to create a SalesLogix table ID. The code samples are in VBScript, but I do get asked every now and then how to create a table ID from .NET. An easy enough translation from VBScript IMO. Here’s a generic method in C# you could use to create table ID values.
private string GetTableId(string table)
{
if (table.Equals(string.Empty) throw new Exception("Table name missing");
OleDbConnection conn = new OleDbConnection(_connstring);
try
{
conn.Open();
OleDbCommand cmd = new OleDbCommand(string.Format("slx_dbids('{0}', 1)", table), conn);
return cmd.ExecuteScalar().ToString();
}
catch
{
throw;
}
finally
{
conn.Dispose();
conn = null;
}
}
Then to use it you’d just call it like this (but if you need to be told this, then should you really be using this??)
sring accountid = GetTableId("account");



