Getting company info

antoinebaudouin
Member Posts: 3
Hi, I need to get the company info that I see when I go to Tools->Setup->Company->Company.
I'm using the eConnect .NET assemblies with GP 9.0 SQL Server2005 and the sample company TWO.
I was able to get Customers, Vendors, Items, Purchase_Order_Transactions, etc with the eConnectRequester method, specifying the DOCTYPE.
I was expecting to find a doctype to get the company data, something like
eConnectOut.DOCTYPE = "Company_Data", but I didn't find it.
eConnect's interface doesn't seem to include a method to execute a SQL query directly such as SELECT * FROM SY01000.
Should I run my query using the data source or should I use something else?
Thank you in advance for any input.
I'm using the eConnect .NET assemblies with GP 9.0 SQL Server2005 and the sample company TWO.
I was able to get Customers, Vendors, Items, Purchase_Order_Transactions, etc with the eConnectRequester method, specifying the DOCTYPE.
I was expecting to find a doctype to get the company data, something like
eConnectOut.DOCTYPE = "Company_Data", but I didn't find it.
eConnect's interface doesn't seem to include a method to execute a SQL query directly such as SELECT * FROM SY01000.
Should I run my query using the data source or should I use something else?
Thank you in advance for any input.
Antoine Baudouin
0
Comments
-
Solved!
Here's my code. It works fine.
using System.Data.SqlClient;
SqlConnection oSqlConnection = new SqlConnection();
oSqlConnection.ConnectionString =
"Data Source=" + Configuration.Server +
";Initial Catalog=TWO;User=" + DBUserName + ";Password=" + DBPassword;
oSqlConnection.Open();
SqlCommand oSqlCommand = oSqlConnection.CreateCommand();
String sSQL = String.Empty;
sSQL += "SELECT CMPNYNAM FROM SY01500 ";
sSQL += "WHERE INTERID = '" + Configuration.CompanyDB + "'";
oSqlCommand.CommandText = sSQL;
SqlDataReader oSqlDataReader = oSqlCommand.ExecuteReader();
oSqlDataReader.Read();
sCompanyName = oSqlDataReader.GetString(0);
oSqlConnection = new SqlConnection();
oSqlConnection.ConnectionString = "Data Source=" + Configuration.Server +
";Initial Catalog=TWO;User=" + DBUserName + ";Password=" + DBPassword;
oSqlConnection.Open();
oSqlCommand = oSqlConnection.CreateCommand();
sSQL = String.Empty;
sSQL += "SELECT CITY, STATE, ZIPCODE, CMPCNTRY FROM SY01500 ";
sSQL += "WHERE INTERID = '" + Common.Data.Configuration.CompanyDB + "'";
oSqlCommand.CommandText = sSQL;
SqlDataReader oSqlDataReader = oSqlCommand.ExecuteReader();
oSqlDataReader.Read();
sCity = oSqlDataReader.GetString(0);
Have a good one!Antoine Baudouin0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions