专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Informix

高版本SDK,C#联接ADO.NET连接informix数据库失败

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
高版本SDK,C#连接ADO.NET连接informix数据库失败!
引用IBM.DATA.informix.dll(2.81.0.0和3.0.0.2版本执行如下代码可以正常连接到数据库)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using IBM.Data.Informix;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            IfxConnection c = null;
            try
            {
                c = new IfxConnection("Server=ontest;Host=10.1.1.14;Service=8888;Protocol=onsoctcp;Database=testdb;UID=user;Password=xxx;CLIENT_LOCALE=zh_CN.GB18030-2000;DB_LOCALE=zh_CN.GB18030-2000;connection timeout=30;connection reset=False");
                c.Open();
                this.Text = c.Server + " " + c.ServerType + " " + c.ServerVersion;
                Clipboard.SetText(this.Text);
//返回ontest Informix 11.50.0000 FC6
            }
            finally
            {
                if (c != null && c.State != ConnectionState.Closed) c.Close();
                if (c != null) c.Dispose();
                c = null;
            }
        }
    }
}

引用IBM.DATA.informix.dll(9.0.0.2或者9.7.4.4版本无法连接上数据库),用如下代码无法连接上数据库
 //http://www.ibm.com/developerworks/forums/message.jspa?messageID=14628016 (参考此链接未能解决问题,在Setnet32中已经配置了服务器和客户端的编码集,)
            IfxConnectionStringBuilder cb = null;
            IfxConnection c = null;
            try
            {
                cb = new IfxConnectionStringBuilder();

                cb.Database = "testdb";
                cb.Server = "10.1.1.14:8888";
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

  • asp 连接informix出错解决方案

    asp 连接informix出错 asp 连接informix出错。odbc test connection成功。 出错提示: “Microsoft OLE DB Provider for ODBC...

  • 怎么提高查询效率

    如何提高查询效率 表架构: 主表+明细表,明细数据按月存储,即: 主表:wamia 明细:wamia201001 wamia201002 …… 目标: 1、...

  • 询问下informix的价格,该如何处理

    询问下informix的价格 想问下关于windows下informix choice版11.5和11.7的价格大概是多少啊?按CPU算的 ------解决方案----------...

  • informix与db2,该如何处理

    informix与db2 informix与db2,应该学哪个? ------解决方案-------------------- 那要看你工作的需要了。 以及以后客户的需要...

  • sqexplain.out 怎么分析

    sqexplain.out 如何分析? SQL code Table map : ---------------------------- Internal name Table name ---------...

  • informix建表,该怎么处理

    informix建表 有个时间想取系统当前时间 怎么设啊? SQL code create table s ( start time --想要是系统当前时间,怎么设置? ) ---...

  • informix -271异常

    informix -271错误 1、谁有 informix 授权号啊,能不能帮忙送一个啊??先借我用一下啊!!邮箱是:lymusic2007@126.com 万分感激!!! 或者请...

  • 急答案,送分,关于Informix SQL 字符转ASCII码

    急!急!在线等答案,送分,关于Informix SQL 字符转ASCII码 各位高手,在Informix数据库中,怎样把char字符获取它的ASCII码值?看起来好像很简...

  • 请问informix存储过程调用远端数据库方法

    请教informix存储过程调用远端数据库方法 我现在想实现从另一台机器上的informix数据库的表中取数,插入到本地的表中, 数据量大概...

  • informix 存储过程中数据类型有关问题,

    informix 存储过程中数据类型问题,急。。。。 目的想实现的是从数据库中把数据取出来放到一个单元格中查出来,每条记录用","格开。 ...

热门推荐: