CFrontDotNet Initialization Error

matthew_gratexmatthew_gratex Member Posts: 4
I'm trying to connect to an SQL Nav database from ASP.Net using the CFrontDotNet library. We have set the web.config file to impersonate identity because the database uses Windows authentication.

When we run the code the first time, it works perfectly but when we go to run it a second time it fails with the error:

"The Navision CFront initialization failed"

It takes an iisreset to fix it.

Here is the code:

Dim cFront As New Microsoft.Navision.CFront.CFrontDotNet(Microsoft.Navision.CFront.NavisionDriverType.Sql)
cFront.LoadLicenseFile(Server.MapPath("lic.flf"))
cFront.ConnectServerAndOpenDatabase("machinename", Microsoft.Navision.CFront.NavisionNetType.SqlDefault, "dbname", 2000, False, True, "", "")
cFront.OpenCompany("CoName")
cFront.CloseCompany()
cFront.CloseDatabase()
cFront.DisconnectServer()
cFront.Dispose()
cFront = Nothing

Any help would be greatly appreciated!!!

Comments

Sign In or Register to comment.