I’m writing some C# code to import State, County and City Sales and Use tax rates into selected Navision tables. I already know the Navision destination tables and the order in which to import. Question 1: Which Navision object(s) and method(s) to use to write to one or more rows and columns in a specified Navision table regardless to wether the Navision tables are in a SQL Server or Navision database platform? Question 2: Which Navision object(s) and method(s) to use to read one or more rows and columns from a (non-Navision) SQL Server table or text file?
Hi Michael, firstly not sure how you are going to use C#, I guess a ODBC or C/FRONT thing, but… In reality, you should not be doing it this way. You shoul contact your NSC, and have them create a Dataport for you. NSCs are trained in all the aspects in Navision, and will understand both Sales Tax AND Dataporting in detail. Sure learn it for your self, that is great, but to get started, and for something as critical as Sales Tax, thats what your NSC is there for. Don’t fight navision, doing it the Navision way will in the end be your best bet.
Let me clarify. By “Navision object(s)” I mean C/FRONT objects. I had succeessed in using one of these object almost a year ago to write to write one or more rows and columns in a specified Navision table regardless to wether the Navision tables are in a SQL Server or Navision database platform as well as read one or more rows and columns from a (non-Navision) SQL Server table or text file. Due to circumstances beyond my control I have no access to the Navision NSC of the company for which I work. I can not use a data port due to the business requirements of the project on which I am working. I must develope this in C#. I already know what database,tables and columns to both read from and write to. Unfortunately, I have no recollection or notes regarding which object(s) I used or how to used them. So, if you would be so kind, would you please either advise me as to my queries or identify some other source who would? Thank you very much for your time and attention.
So if I understand correctly, you have a C# wrapper to tie into the C++ libraries of C/FRONT (or maybe you are just calling them direct). Now you want to write a new interface in C# using C/FRONT to get data into Navision. Is that correct?
Yes. I must write a new interface in C# using C/FRONT to write data into and read data out of Navision regardless as to wether the Navision tables are in a SQL Server or Navision database platform.
C/FRONT is a library of C++ functions that allow you to access a Navision Database. There is a DLL for C/SIDE, and one for SQL, so you should be able to write one code set that works on both platforms, but do test on both, and make sure it works correctly, since there are some differences to the two. C/FRONT has no connection in any way what so ever with Navision objects or “methods”, (except in so far as you access Navision tables which are objects). You will develop your own C# objects which will use the Navision C/FRONT DLLs and libraries to interface to the Navision Database of your choice. At this point do a search on this site to find more information about C/FRONT.
I think we’ve arrived at the core of my problem. I’ve rephrased my original questions accordingly. Which C/FRONT DLLs and/or libraries and/or methods and/or properties must I use to access Navision tables (which are objects) for SQL? Which C/FRONT DLLs and/or libraries and/or methods and/or properties must I use to access Navision tables (which are objects) for C/SIDE?
Hi, There is C code example in Navision installation cd. Just look to it.
Basically there is just one set of libraries, you link these into your C++ app, and things are fine. Then at run time, if you have SQL, then you use cfrontsql.dll to connect to a SQL db, or CFRONT.DLL to link to a C/SIDE database. But there should not be much different n the code, except how you connect to the db.
CFRONT.DLL and CFRONTSQL.DLL are Unusable When I attempt to add a reference to either cfront.dll or cfrontsql.dll I get the same error message: “A reference to ‘C:\Program Files\Microsoft Business Solutions-Navision\SDK\CFRONT\CFRONTSQL.DLL’ could not be added. This is not a valid assembly or COM component. Only assemblies with extention ‘dll’ and COM components can be referenced. Please make sure the file is accessible, and that it is a valid assembly or COM component.” I’ve also tried registering both dll’s using regsvr32, but I get the error: [i]“CFRONT.DLL was loaded, but the DllRegisterServer entry point was not found. CFRONT.DLL does not appear to be a .DLL or .OCX file.”[i] Please advise.
4.0 SP1 contains .NET wrapper classes. Otzherwise you need to write your own wrapper classes to encapsulate the dll calls into a .NET assembly.
Cfront.dll and Cfrontsql.dll don’t have DllRegisterServer func. They are old C style func. library. If you can’t use loadlib() use Cfront.ocx.