Navision C5 and ASP.NET (ODBC)

  • Thread starter =?ISO-8859-1?Q?Michael_B=F8cker-Larsen?=
  • Start date
?

=?ISO-8859-1?Q?Michael_B=F8cker-Larsen?=

Hi

I'm developing a hotel booking system, an ASP.NET frontend to C5 3.0. I'm having
difficulties connecting to C5 through ODBC.

I'm using .NET Framework v1.1 and therefore the System.Data.Odbc Namespace.
I'm using the C5ODBC driver for C5 3.0 and have tested it succesfull for for
instance Microsoft Excel.

When the I call the Open() method on the OdbcConnection the application "stalls"
, that is the browser keeps on loading and loading.

The data source is a System DSN using the C5ODBC driver. Data sourse settings:
Datafile: c:\program files\microsoft navision\c5\c5data.dat
Additional Parameters: c:\program files\microsoft navision\c5\
... and the rest is by default

Could have something to with the authorization-schema in .NET (forms, windows,
etc.)? Or could it be something to do with my config files?: web.config,
machine.config. I have not changede any of them.

Is it even know to be possible to connect to C5 from ASP.NET? If the above
approach is incorrect or there exists a better way please advice.

In case this mail has reached the wrong place for this type of problems, could
you please redirect it to someone who could assist me, or some place to find
information, please (and please notify me as well). I have searched through
newsgroups, asp.net forums, and have not been able to find anything.

Best regards
Michael Bøcker-Larsen
Aalborg University, Denmark
 
C

CT

Can you get the ODBC connection to work from a Windows application? Do you
not get a timeout exception?
 
C

CT

You can set the ConnectionTimeout property to a desired value. However,
since the default is 15 (seconds) I wonder why you don't get the error. Can
you create a DSN and then use that from the ODBCConnection class?
 
M

Michael Bøcker-Larsen

Hi

Yes I can create a DSN (using connectstring "DSN=c5booking;")
There is no problem creating the objects from the Odbc Namespace but
when i call the method Open() on the OdbcConnection the problem
occours... no time out.
 
M

Michael Bøcker-Larsen

Hi Carsten

Here is the page trying to open the connection. Need you see more? my
web.config forinstance?


using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
//using Microsoft.Data.Odbc;
using System.Data.Odbc;


namespace Booking
{
public class DefaultPage : PageTemplate
{
protected DataGrid WeekGrid;

private void Page_Load(object sender, System.EventArgs e)
{
if ( IsPostBack )
{
}
else
{
string languageCode = "da";
string userID = "Slagger";
SetLanguageAndUser(languageCode, userID);
}

//string connectstring = "DRIVER=C5ODBC; DSN=c5booking;
uid=supervisor; pass=<hidden>";
//string strConnectString =
"DSN=c5booking;UID=supervisor;PWD=super;DBQ=c:\program files\microsoft
navision\c5\c5data.dat;CODEPAGE=1252;DIRS=c:\program files\microsoft
navision\c5;UID=supervisor;PWD=ô×Y„;NAMECASE=Unchanged;DISPLAYNAME=DICT
;HIGHASCII=TRUE;BLANKISNULL=FALSE;DEBUG=FALSE;
//string strConnectString = "DRIVER=C5ODBC; DSN=c5booking";
string strConnectString = "DSN=c5booking;";
//string strConnectString = "driver={C5ODBC}; server=localhost;
uid=supervisor; pwd=<hidden>";
//string strConnectString = "FILEDSN='C:\\Program Files\\Common
Files\\ODBC\\Data Sources\\c5booking (not sharable)'";
OdbcConnection myConnection = new OdbcConnection(strConnectString);
string sql = "SELECT Nummer FROM OrdLinie";
//string sql = "select * from room";
//OdbcDataAdapter myCommand = new OdbcDataAdapter(sql, myConnection);

try
{
myConnection.Open();
//DataSet dataSet = new DataSet();
//myCommand.Fill(dataSet,"Ordlinie");
}
catch (Exception ex)
{
Response.Write("Connection error: " + ex.ToString());
}
//WeekGrid.DataSource=dataSet.Tables["Ordlinie"].DefaultView;
//WeekGrid.DataBind();

myConnection.Close();

// This sets the help file's url for this page
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top