[Mono-list] compiling myodbc app on linux
mind
mind <mind@rsk.rz.pl>
Wed, 1 Jan 2003 13:12:18 +0100
hi there,
what about compiling ODBC application on linux (MyODBC 2.x, or 3.x)?
can it be done?
after successfull instalation of mono ('hello world!' compiles ok) and
libmyodbc (2.50.39-3) on Debian i cannot connect to odbc provider,
why?
what i'm doing wrong?
greetz,
btw Happy New Year 2 All Developers! :D
/pd
---
error message is:
MySqlSimple.cs(17) error CS0246: Cannot find type `OdbcConnection'
Compilation failed: 1 error(s), 0 warnings
ps. i set up $MONO_PATH to /usr/lib/odbc/ where libmyodbc.so can be
found. maybe i should use 3.x version instead of 2.x one?
---
simple source code looks like this:
---
using System;
using System.Data.Odbc; // should be using Microsoft.Data.Odbc ??
class My
{
static void Main()
{
// Connect
OdbcConnection connection = new OdbcConnection("DSN=MySQL");
connection.Open();
// Write info
Console.WriteLine("Database:\t" + connection.Database);
Console.WriteLine("Server ver.:\t" + connection.ServerVersion);
// Close Connection
connection.Close();
}
}