开发者

Using System Datasource instead of User Datasource as ODBC Connectionstring

开发者 https://www.devze.com 2023-02-19 17:29 出处:网络
OdbcConnection DbConnection = null; try { DbConnection = new OdbcConnection( \"Driver=SQL Anywhere 10;\" +
OdbcConnection DbConnection = null;
        try
        {
            DbConnection = new OdbcConnection(
                "Driver=SQL Anywhere 10;" +
                "Uid=user;" +
                "pwd=pass;" +
                "Dsn=<name>");
            DbConnection.Open();
        }开发者_如何学JAVA
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
            Console.ReadKey();
            System.Environment.Exit(0);
        }

Now my problem is that if <name> is a User-Datasourcename everything is fine. On the other hand if i use a System-Datasourcename as <name> it throws me an error that it can't find the Datasourcename. Any hints how i could use a System DSN?

Thanks in advance.

Two example Images: http://i.stack.imgur.com/3h7vh.png http://imgur.com/5Govx


X64 DSN is not visible for a X86 Application...

0

精彩评论

暂无评论...
验证码 换一张
取 消