• <legend id='hz1P6'><style id='hz1P6'><dir id='hz1P6'><q id='hz1P6'></q></dir></style></legend>

      <small id='hz1P6'></small><noframes id='hz1P6'>

    1. <tfoot id='hz1P6'></tfoot>

      1. <i id='hz1P6'><tr id='hz1P6'><dt id='hz1P6'><q id='hz1P6'><span id='hz1P6'><b id='hz1P6'><form id='hz1P6'><ins id='hz1P6'></ins><ul id='hz1P6'></ul><sub id='hz1P6'></sub></form><legend id='hz1P6'></legend><bdo id='hz1P6'><pre id='hz1P6'><center id='hz1P6'></center></pre></bdo></b><th id='hz1P6'></th></span></q></dt></tr></i><div id='hz1P6'><tfoot id='hz1P6'></tfoot><dl id='hz1P6'><fieldset id='hz1P6'></fieldset></dl></div>
          <bdo id='hz1P6'></bdo><ul id='hz1P6'></ul>

        如何连接到 DB2?

        时间:2023-09-17

        <i id='hV4L9'><tr id='hV4L9'><dt id='hV4L9'><q id='hV4L9'><span id='hV4L9'><b id='hV4L9'><form id='hV4L9'><ins id='hV4L9'></ins><ul id='hV4L9'></ul><sub id='hV4L9'></sub></form><legend id='hV4L9'></legend><bdo id='hV4L9'><pre id='hV4L9'><center id='hV4L9'></center></pre></bdo></b><th id='hV4L9'></th></span></q></dt></tr></i><div id='hV4L9'><tfoot id='hV4L9'></tfoot><dl id='hV4L9'><fieldset id='hV4L9'></fieldset></dl></div>

        <tfoot id='hV4L9'></tfoot>

        <small id='hV4L9'></small><noframes id='hV4L9'>

            <tbody id='hV4L9'></tbody>
            <legend id='hV4L9'><style id='hV4L9'><dir id='hV4L9'><q id='hV4L9'></q></dir></style></legend>
                <bdo id='hV4L9'></bdo><ul id='hV4L9'></ul>

                1. 本文介绍了如何连接到 DB2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我必须连接到安装在其他系统上的 DB2 数据库.我有服务器的机器名称、我想连接的数据库名称、端口号和凭据.我的系统上没有为 DB2 安装任何客户端.我想使用 OLEDB 连接.

                  I have to connect to a DB2 database installed on some other system. I have the machine name of the server, the database name to which I would like to connect to, the port number and the credentials. I do not have any client installed on my system for DB2. I want to use OLEDB connections.

                  我可以在不安装客户端的情况下实现这一点吗?还让我知道哪些参考 dll 将帮助我实现这一目标,即我应该使用什么 - IBM OLE DB Provider for DB2 或 Microsoft OLEDB provider for IBM DB2 或其他?我在哪里可以找到它们?

                  Can I achieve this without installing a client? Also let me know what reference dlls would help me in achieving this i.e. what should I use - IBM OLE DB Provider for DB2 or Microsoft OLEDB provider for IBM DB2 or some other? Where do I find them?

                  推荐答案

                  OLEDB 参考 .NET DB2 OLEDB 先决条件

                  另请参考:有什么区别OLE DB 和 ODBC 数据源之间的关系?

                  对于ODBC连接,我使用如下

                  连接字符串

                    <add name="DB2ConnectionString_XA"
                      connectionString="Driver={IBM DB2 ODBC DRIVER};Database=MyDB;Hostname=DB2GWXX;Protocol=TCPIP;Port=3700;Uid=ffghxa;Pwd=xxxx;"/>
                  

                  代码:

                  using (OdbcConnection odbcConnection = new OdbcConnection(db2ConnectionString))
                  {
                      odbcConnection.Open();
                  
                      // string commandText = "";
                  
                      using (OdbcCommand command = new OdbcCommand(commandText, odbcConnection))
                      {
                          command.CommandType = System.Data.CommandType.Text;
                          using (OdbcDataReader reader = command.ExecuteReader())
                          {
                              if (reader.HasRows)
                              {
                                  while (reader.Read())
                                  {
                                  }
                              }
                          }
                      }
                  }
                  

                  这篇关于如何连接到 DB2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 C# 进行查询验证 下一篇:来自 .NET 的参数化 DB2 查询

                  相关文章

                  • <bdo id='eYV76'></bdo><ul id='eYV76'></ul>
                  <tfoot id='eYV76'></tfoot>

                  <small id='eYV76'></small><noframes id='eYV76'>

                2. <i id='eYV76'><tr id='eYV76'><dt id='eYV76'><q id='eYV76'><span id='eYV76'><b id='eYV76'><form id='eYV76'><ins id='eYV76'></ins><ul id='eYV76'></ul><sub id='eYV76'></sub></form><legend id='eYV76'></legend><bdo id='eYV76'><pre id='eYV76'><center id='eYV76'></center></pre></bdo></b><th id='eYV76'></th></span></q></dt></tr></i><div id='eYV76'><tfoot id='eYV76'></tfoot><dl id='eYV76'><fieldset id='eYV76'></fieldset></dl></div>
                3. <legend id='eYV76'><style id='eYV76'><dir id='eYV76'><q id='eYV76'></q></dir></style></legend>