【Sybase】用odbc连接Sybase数据库

 1 string connStr = @"Driver={Sybase ASE ODBC Driver};NA=" + v_strServer + ",4100"
 2                                                                + ";Uid=" + v_strUsername
 3                                                                + ";Pwd=" + v_strPwd
 4                                                                + ";Database=" + v_strDBase
 5                                                                + ";Charset=UTF8";
 6                 OdbcConnection odbConn = new OdbcConnection(connStr);
 7                 odbConn.Open();
 8                 OdbcCommand odcomm = new OdbcCommand(v_selectStr, odbConn);
 9                 //odcomm.CommandText = v_selectStr;
10 
11                 OdbcDataAdapter odbcAdapter = new OdbcDataAdapter(odcomm);
12 
13                 odbcAdapter.Fill(dt);
14                 odcomm.Dispose();
15                 odbConn.Close();

 

posted @ 2014-07-31 19:57  zp_Alex  阅读(3611)  评论(0编辑  收藏  举报