Connecting to 3.60 via C/ODBC from .NET app

Hi guys. I’m trying to connect via C/ODBC from a .NET application. Does anyone have any experience of this? I’ve tried using both DSNs and calling the driver directly and passing parameters in the ODBCConnection String, but both result in errors - typically stating: DIAG [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) The Navision DB is running remotely, and I know that the DSN works as I have used it for Crystal… Any ideas? Kind regards, Mark

Right, it turns out that C/ODBC will not support .NET datasets (http://www.mibuso.com/forum/viewtopic.php?t=2607). Instead you have to create a data reader and manually step through each line of data that your SQL query returns and either create an array or build a datatable one row at a time. For anyone’s interest: Dim DBCon As New Odbc.OdbcConnection("DSN=Sample C/ODBC 32 bit; CN=xxx; NType=xxx; SName=xxx; SERVER=N; CSF=Yes; UID=xxx; PWD=xxx") Dim sSQL As String = "SELECT * FROM Item" Dim dt As New DataTable Dim c As New DataColumn dt.Columns.Add(c) Dim com As New Odbc.OdbcCommand(sSQL, DBCon) DBCon.Open() Dim r Dim reader As Odbc.OdbcDataReader = com.ExecuteReader() While (reader.Read()) r = dt.NewRow() r.Item(0) = reader.Item(0) dt.Rows.Add(r) End While DBCon.Close() The above code is possibly not as elegant as could be, but it does work. Hope this helps someone! mark