1个回答
展开全部
//使用ODBC连接DB2
private void button1_Click(object sender, EventArgs e)
{
string conString = @"driver={IBM DB2 ODBC DRIVER};database=devp;hostname=172.20.30.107;
port=50000;protocol=TCPIP;uid=db2inst1;pwd=db2; CurrentSchema=TK";
OdbcConnection con = new OdbcConnection(conString);
con.Open();
OdbcCommand cmd = new OdbcCommand("select * from tbdesign", con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("OK");
}
private void button1_Click(object sender, EventArgs e)
{
string conString = @"driver={IBM DB2 ODBC DRIVER};database=devp;hostname=172.20.30.107;
port=50000;protocol=TCPIP;uid=db2inst1;pwd=db2; CurrentSchema=TK";
OdbcConnection con = new OdbcConnection(conString);
con.Open();
OdbcCommand cmd = new OdbcCommand("select * from tbdesign", con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("OK");
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询