Navision Attain Database access via C/ODBC in ASP.NET Application

Navision Software was purchased by Microsoft and now it is supported by Microsoft Business Solutions together with Microsoft Great Plains, Axapta, Solomon, Microsoft Retail Management System and Microsoft CRM. Navision has extremely strong position on mid-size European and US markets, plus it has excellent manufacturing solution. Our goal is to help IT departments to support and tune Navision with in-house expertise and skills. The topic of this article is Navision database access from ASP.NET application 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 Database Server, Navision Application Server and Navision Client. These components are installed on Windows XP. You also need to install C/ODBC component form Navision Attain CD.

2. Let's create ODBC DSN for Navision data access. Select Control Panel -> Administrative Tools -> Data Sources (ODBC). Then select System DSN tab and press Add button. We'll use C/ODBC 32-bit data access driver. We'll name Data Source Name Navision, Connection leave Local. As the database (Database button) select Program FilesNavision AttainClientdatabase.fdb (demo database). Then click Company button ? we'll use CRONUS demo company. It is important for C/SIDE correct database access to setup proper options for C/ODBC connection. Press Options button and look at the options available ? we'll need Identifiers parameter ? it defines identifiers types, which will be transferred to the client application. In order to work correct with MS SQL Server 2000 with C/ODBC source we need to use these type: "a-z,A-Z,0-9,_". Now DNS is done. Let's create Linked Server.

3. Open MS SQL Server Enterprise Manager. Open server tree for the server, which you plan to use, for this server open Security folder and Lined Servers. With right click select New Linked Server in context menu. In the dialog box opened in the Provider Name select Microsoft OLE DB Provider for ODBC Drivers. Let's name our Linked Server NAVISION. In Data Source string enter ODBC DSN name - NAVISION in our case. Linked Server is ready! Let's select tables list and look at the data from Navision Attain database.

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

CREATE PROCEDURE NavisionCustomers AS

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

RETURN

Let's clarify some points here. TRACEON(8765) directive allows us to work with the data of variable length, returned by C/ODBC driver. Without it we can not select Navision tables fields ? we will have these errors:

OLE DB error trace [Non-interface error: Unexpected data length 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 provider 'MSDASQL' returned an unexpected data length for the fixed-length column '[MSDASQL].Ship_to_Filter'. The expected data length is 250, while the returned data length is 1.

OPENQUERY command opens linked server and gives it execution request, and returns record set selected. Directives ANSI_NULLS and ANSI_WARNINGS are required ? they provide the possibility of the execution for heterogeneous requests. To test the procedure you can give its name in MS SQL Query Analyzer ? EXEC NavisionCustomers

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

6. Launch WebMatrix, select creation of the Data Pages -> Editable Data Grid in the wizard screen. Let's keep all the defaults suggested. On the access page created we'll change the header to Navision Attain Customers, select Verdana font and the font size desired. Next place on the page the component SqlDataSourceControl and tune it's ? Connection String : server='(local)'; database='Alba';trusted_connection=true (change server and database name to your actual names), and SelectCommand ? as EXEC NavisionCustomers

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

8. Next switch to code edition mode and make these changes:

? In the DataGrid_Delete method let's correct the request for the customer deletion to the one we need

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

9. Launch our application 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 nationwide Microsoft CRM, Microsoft Great Plains customization company, serving Chicago, Boston, San Francisco, San Diego, Los Angeles, Houston, Dallas, Atlanta, Miami, Montreal, Toronto, Vancouver, Moscow, Europe and internationally ( http://www.albaspectrum.com ), he is Microsoft CRM SDK, Navision, C#, VB.Net, SQL, Oracle, Unix developer.

emergency cleaning services Deerfield ...
In The News:

Americans average 10-plus hours online daily, according to recent survey, splitting time between streaming shows on TV and browsing websites on multiple devices.
Boost your smartphone privacy instantly with these security tweaks for iPhone and Android that limit ad tracking, hide notifications and prevent unauthorized access.
Platforms like Hoax Tech and JS Click Cloaker help cybercriminals bypass detection systems using machine learning to selectively display scam content to victims.
A new battery recycling technique transforms old lithium-ion batteries into high-performance components that retain 88% capacity after 500 cycles with minimal waste.
Google's Android operating system can warn users about earthquakes before the shaking even begins – and there are ways to do it on your iPhone, too.
Meta's new gesture control wristband might just be the most seamless way to control a computer yet. And no, it doesn't require surgery, a camera, or even a touchscreen. All it needs is your wrist.
Long-haul trucks are now being upgraded with a surprising twist, thanks to California-based startup Revoy. Their electric boost doesn't replace diesel but works alongside it to cut emissions and fuel costs without major disruption.
PayPal and Venmo just rolled out something big: AI-powered scam alerts for Friends and Family payments.
As data centers multiply across the United States, energy demand is increasing at a rapid pace. This has not escaped the notice of large investment firms from Wall Street.
The Unicode Consortium, the nonprofit organization that maintains the Unicode Standard to ensure emojis work across devices, has announced Unicode 17.0, which includes nine new emojis slated for release this fall, in September 2025.
OpenAI is one of the world's leading AI research labs. Founded in 2015, it's behind some of today's most talked-about tools, including GPT, DALL·E, and ChatGPT.
Ever catch your dog staring at the screen during movie night and wonder if they're actually watching? Turns out, they might be. A new scientific study from Auburn University found that many dogs really do engage with television, and not all pups react the same way.
Stop the scammers from making contact in the first place. They're getting your parents' contact information and much more personal data besides, from somewhere.
The Walker S2 robot from UBTech autonomously exchanges its batteries in just three minutes, allowing continuous operation in car factories operated by BYD, Nio and Zeekr.
The FX Super One electric MPV from Faraday Future offers flexible seating, zero-gravity recliners and an AI system that creates a personal connection between driver and vehicle.
Practical solutions for reducing unwanted charity mail, political texts and email spam by opting out of shared lists, replying "STOP" and using data removal services.
Delta's new AI pricing system eliminates static airfares for personalized rates based on individual data, raising questions about fairness while promising optimized revenue.
AI data centers are straining the power grid across 13 states, contributing to a $9 billion increase in electricity costs, and PJM customers face monthly bill increases of $25 or more.
Artificial intelligence is transforming the music industry as AI-generated bands like The Velvet Sundown earn substantial streaming revenue, prompting lawsuits from major record labels.
Microsoft phishing scams use fake security alerts and links that redirect to credential-stealing pages with warning signs, including urgent language and unusual senders.
Stay up to date on the latest AI technology advancements and learn about the challenges and opportunities AI presents now and for the future.
Tesla vehicles manufactured since mid-2021 with AMD Ryzen processors can now access Grok 4, xAI's witty conversational assistant designed to make drives more engaging.
Understand how technology affects mental health through five concepts, including blue light exposure, screen time management and algorithmic bias.
Electric vehicle maker Lucid adds hands-free driving through an over-the-air update for Air sedan owners with the DreamDrive Pro package and Gravity SUV support coming later.
Protect your home network from hidden dangers, including router vulnerabilities, ISP tracking and smart device weaknesses with proper encryption, firmware updates and VPN technology.

Why Java RDBMS?

It is a well known fact that Java as a... Read More

Builders Beware

Which Type of Shop Can Rely On A Home Built... Read More

10 Ways to Learn a Software

Following tips help you to learn a software in lesser... Read More

Navision Attain Database access via C/ODBC in ASP.NET Application

Navision Software was purchased by Microsoft and now it is... Read More

Understanding Document Management

The term "document management" and "paperless office" is the subject... Read More

Linux ? Keyboard Or Mouse

Just stress testing one of the latest Linux distributions. Been... Read More

eConnect: eCommerce Development for Microsoft Great Plains

Microsoft Business Solutions Great Plains has several options to enable... Read More

Microsoft Great Plains IV: Inventory Management

Great Plains Inventory Management (IV) module gives your business a... Read More

Microsoft Great Plains Implementation in Russia ? Overview for Consultant

Microsoft Business Solutions Great Plains is very popular ERP platform... Read More

eStore Advantage ? Extending Microsoft eConnect for MBS Great Plains

eStore Advantage allows front-office applications to communicate with back-office business... Read More

Great Plains Dexterity Programming ? Overview For Developer

Looks like Microsoft Great Plains becomes more and more popular,... Read More

The Hidden Power of Online Manual

Writing software manuals is boring, isn't it? We often think:... Read More

Microsoft CRM Customization ? Programming Closed Email Activity

Microsoft CRM is CRM answer from Microsoft and attempt to... Read More

Does your Company have Documentum?

Are you lost in the mess of documents that get... Read More

Keeping Track

One of the things we can be as certain of... Read More

Design a Web Album Using Adobe Photoshop- Part 2

So let's begin crunching down these 300 images using Adobe... Read More

Computer Based Language Development and Spell-checking

Language development computer: Computer-based method for aiding language development seems... Read More

eCommerce development for Microsoft Great Plains: tools and highlights for programmer

Microsoft Business Solutions Great Plains, former Great Plains Software Dynamics... Read More

IT Strategy for Midsize Business: Microsoft vs. Java, Great Plains & CRM

Midsize business or non-profit organization should decide if one-vendor solution... Read More

Microsoft Navision Customization and Reporting ? Tips For Programmer/IT Specialist

C/SIDE (Client/Server Integrated Development Environment) - The core of... Read More

Daffodil DB: Web Database

What is a Web Database?A web database is a database... Read More

Anti-Spyware Protection ? Holes in the Shining Armor

Looking at all the ads which promise to get rid... Read More

Microsoft Great Plains: Government & Non-Profit Organization ? Workflow Implementation

Usually workflow & messaging is realized in CRM and then... Read More

Lotus Domino: Reports and Connectors ? Crystal Reports, XML, ODBC/JDBC, OLE

Lotus Notes Domino is very efficient in electronic document workflow... Read More

SyncUp ? A File/Folder Synchronizer For Windows

SyncUp, a file synchronizer is designed to assist the home... Read More

insured cleaning company Morton Grove ...