Software informational articles

Navision attain list approach via c/odbc in concentration - software


Navision Software was purchased by Microsoft and now it is supported by Microsoft Affair Solutions at once with Microsoft Great Plains, Axapta, Solomon, Microsoft Retail Management Arrangement and Microsoft CRM. Navision has enormously bright arrangement on mid-size European and US markets, plus it has exceptional manufacturing solution. Our goal is to help IT departments to assist and tune Navision with in-house expertise and skills. The topic of this commentary is Navision file contact from ASP. NET claim via C/ODBC interface. Our goal will be ASPX page accessing Navision Customers.

Let's begin

1. In our case we will use Navision Attain 3. 6 with Navision File Server, Navision Attention Attendant and Navision Client. These gears are installed on Windows XP. You also need to bed in C/ODBC element form Navision Attain CD.

2. Let's coin ODBC DSN for Navision data access. Choose Be in command of Panel -> Administrative Tools -> Data Sources (ODBC). Then decide on Arrangement DSN tab and press Add button. We'll use C/ODBC 32-bit data approach driver. We'll name Data Font Name Navision, Correlation leave Local. As the file (Database button) cliquey Curriculum FilesNavision AttainClientdatabase. fdb (demo database). Then click Business close - we'll use CRONUS demo company. It is chief for C/SIDE accurate folder contact to setup appropriate options for C/ODBC connection. Press Options close and look at the options obtainable - we'll need Identifiers parameter - it defines identifiers types, which will be transferred to the client application. In order to work accurate with MS SQL Attendant 2000 with C/ODBC basis we need to use these type: "a-z,A-Z,0-9,_". Now DNS is done. Let's conceive Allied Server.

3. Open MS SQL Attendant Activity Manager. Open attendant tree for the server, which you plan to use, for this head waiter open Collateral folder and Lined Servers. With right click choice New Coupled Head waiter in circumstance menu. In the dialog box opened in the Giver Name decide on Microsoft OLE DB Contributor for ODBC Drivers. Let's name our Allied Ma?tre d' NAVISION. In Data Basis filament enter ODBC DSN name - NAVISION in our case. Associated Ma?tre d' is ready! Let's choose tables list and look at the data from Navision Attain database.

4. Next we need to build small stored course of action for sales data selection. Here is the text of the procedure: SET ANSI_NULLS ON SET ANSI_WARNINGS ON GO

CREATE Method NavisionCustomers AS

DBCC TRACEON(8765) SELECT No_, Name, Address, City, Acquaintance FROM OPENQUERY(NAVISION, 'SELECT * FROM Customer')


Let's filter some points here. TRACEON(8765) directive allows us to work with the data of alterable length, returned by C/ODBC driver. Devoid of it we can not decide on Navision tables fields - we will have these errors:

OLE DB error trace [Non-interface error: Unexpected data chunk returned for the column: ProviderName='MSDASQL', TableName='[MSDASQL]', ColumnName='Ship_to_Filter', ExpectedLength='250', ReturnedLength='1']. Server: Msg 7347, Level 16, State 1, Line 1 OLE DB donor 'MSDASQL' returned an unexpected data duration for the fixed-length feature '[MSDASQL]. Ship_to_Filter'. The predictable data extent is 250, while the returned data chunk is 1.

OPENQUERY be in charge opens coupled ma?tre d' and gives it execution request, and takings background set selected. Directives ANSI_NULLS and ANSI_WARNINGS are compulsory - they endow with the leeway of the execution for diverse requests. To test the method you can give its name in MS SQL Query Analyzer - EXEC NavisionCustomers

5. Now we need to build ASP. NET application. Let's use free RAD background ASP. NET WebMatrix. You can get infor and download it at http://asp. net/webmatrix . You need . NET SDK 1. 1 installed, beforehand WebMatrix installation.

6. Launch WebMatrix, choose construction of the Data Pages -> Editable Data Grid in the wizard screen. Let's keep all the defaults suggested. On the admittance page bent we'll alteration the heading to Navision Attain Customers, cliquey Verdana font and the font size desired. Next place on the page the element SqlDataSourceControl and tune it's - Association Cord : server='(local)'; database='Alba';trusted_connection=true (change head waiter and catalog name to your concrete names), and SelectCommand - as EXEC NavisionCustomers

7. For our Data Grid, which will show customers, characterize DataSource as SqlDataSourceControl1, and DatKeyField - as No_

8. Next alter to code copy mode and make these changes:

? In the DataGrid_Delete logic let's adjust the ask for for the consumer deletion to the one we need

? Change DataGrid_Delete code, base on the fields we plan to use

9. Launch our appliance and test it. This is it!

Happy customizing, implementing and modifying! If you want us to do the job - give us a call 1-866-528-0577 or 1-630-961-5918! help@albaspectrum. com

Boris Makushkin is Lead Software Developer in Alba Spectrum Technologies - USA generally Microsoft CRM, Microsoft Great Plains customization company, helping Chicago, Boston, San Francisco, San Diego, Los Angeles, Houston, Dallas, Atlanta, Miami, Montreal, Toronto, Vancouver, Moscow, Europe and worldwide ( http://www. albaspectrum. com ), he is Microsoft CRM SDK, Navision, C#, VB. Net, SQL, Oracle, Unix developer.

Developed by:
home | site map © 2018