Can't get a connection in .net web application using CFRONT

elviselvis Member Posts: 5
edited 2004-05-29 in Navision Attain
I'm stuck at the first hurdle.

I've managed to get a connection using the "CFRONT proxy component for .NET usage v1.2" within a .net windows application (a simple form with a button that initialises the proxy and then calls opendatabase), but can't get a connection within a .net web application. I keep getting "The Server Threw an Exception".

Any ideas what I'm doing wrong?

Comments

  • IanCleggIanClegg Member Posts: 2
    I'm not sure what you mean by "CFRONT proxy component for .NET usage v1.2" In my ignorance I just added a reference to the COM object in my .Net project and everything works fine. The only anomaly was that when I added the line

    CFRONT cf = new CFRONT();

    the intellisense automatically added new CFRONTClasss(). Get rid of the 'Class' and it all seems o.k.

    Also - I used the ConnectServerAndOpenDatabase method rather than separate methods because I'm writing an app that has to connect to both SQL and proprietary systems.
  • elviselvis Member Posts: 5
    Ian, thanks for responding. I am using the OpenDatabase method to ensure that it wasn't the login part causing the problems. Once I get this working I will move to the newer method.

    Is your project using windows forms or web forms? Mine seems to work in a windows form project, but not a web forms project.

    For your information, the "CFRONT proxy component for .NET usage v1.2" is an available download that removes all variant parameters for .NET compatibility.
  • IanCleggIanClegg Member Posts: 2
    Elvis, Actually I've done all my cfront stuff in a class library because I want to use the same functionality in both windows forms and web forms apps - but it works for both and for both SQL and proprietary databases.
  • elviselvis Member Posts: 5
    Ian,

    I've created a class library that works fine in a windows app, but still can't get it to work in a web app.

    Would you happen to have any examples that I could use to test on my machine?
  • fkofko Member Posts: 5
    I'm now in same troubles, have you any ideas since your last post on this?
  • elviselvis Member Posts: 5
    The following is the response from MBS, which made it work perfectly.....

    I found out that in order to use CFRONT.ocx in this way, it needs to be installed as a component service. I followed these steps to get it working:

    Open Component Services (from Administrative Tools).

    Expand to Computers, My Computer, COM+ Applications. Rightclick COM+ Applications and make a new one. In the wizard, create a blank application, just enter a name.

    Doubleclick the application you just made, then click Components. Open Windows Explorer and find CFRONT.ocx (C:\Program Files\Microsoft Business Solutions-Navision\SDK\CFRONT\Cfront.ocx). Drag it into Components. Once it is there, restart the WWW Publishing service, then right click My Computer in Component Services and stop MS DTC, then start MS DTC again (alternatively, just reboot). Let me know if you get stuck with this.

    I got the web application to bring back data from Navision. I did remark the CloseTable, CloseCompany etc, but I think that these lines failed for some other reason.
  • fkofko Member Posts: 5
    Thank's its working now nearly perfect :D
Sign In or Register to comment.