Navision and .net

mstallmannmstallmann Member Posts: 138
edited 2004-03-09 in Navision Attain
I am getting an error message when I am trying to connect to Navision Database using ODBC in .net. It says the ODBC driver does not support that command. I have a feeling that the ODBC driver is not compatible with .net for some reason. Anyone else have this problem? Resolution? Is there a better way to connect, i.e. using the OCX? MBS support said that is beyond thier support level..bunchof *#($#* :evil: :evil: :evil:

Comments

  • DenSterDenSter Member Posts: 8,307
    There is an ODBC driver for Navision, just make sure you have the right one selected in your references in VS, so you don't use invalid commands in your programming. I haven't done this myself, but other people have so it must be possible.
  • hairyjimhairyjim Member Posts: 99
    I have connected to my Navision DB through Visual Studio .net I used the CODBC supplied on the Navision CD.
    Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
  • mstallmannmstallmann Member Posts: 138
    Can you give me more details on how you connected. I am using the following connection string (code syntax is C#):

    this.odbcConnection1.ConnectionString = "DRIVER=C/ODBC 32 bit;UID=mike.stallmann;PWD=PWD;SERVER =N;CN=essai, inc.;RD=No;ML=1033;CD=No;BE=Yes;CC=Yes;RO=No;QTYesNo=Yes;IT=All Except DOT;OPT=Text;PPath=C:\\Program Files\\Microsoft Business Solutions-Navision\\Client;NType=TCP;sName=server;CSF=Yes";

    I tried using a dataset, and then tried a datareader as such:

    this.odbcConnection1.Open();
    System.Data.Odbc.OdbcDataReader Reader;
    Reader = odbcCommand1.ExecuteReader(CommandBehavior.CloseConnection);

    DataGrid1.DataSource = Reader;
    Reader.Read();
    Response.Write (Reader.GetOrdinal("No_"));
    DataGrid1.DataBind();
    Reader.Close();
Sign In or Register to comment.