xp 下如何通过ODBC连接postgresql 如题,我用的postgresql是8.1谢谢帮忙,万分感谢. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用.net来连接,我在网上看的 Microsoft.Data.Odbc.OdbcConnection oODBCConnection; string sConnString = "Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=test1;Uid=postgres;Pwd=chenqing5151!"; oODBCConnection = new OdbcConnection(sConnString); try { oODBCConnection.Open(); } catch (Exception ex) { MessageBox.Show(ex.Message); } string strSQL = "select * from employees"; OdbcDataAdapter da = new OdbcDataAdapter(strSQL, oODBCConnection); System.Data.DataSet ds = new System.Data.DataSet(); da.Fill(ds, "Employees"); dataGrid1.DataSource = ds.Tables["Employees"];需要包含什么头文件吗? 参考:http://www.samool.com/archives/255/有ODBC驱动及连接图例 效率更高的sql语句 jsp+mysql数据库连接内存溢出问题?? 新手提问,Mysql读取excel的方式 mysql -u root -h 127.0.0.1 为何会首先解析成 mysql -uroot -hlocalhost 呢? 一个列转行的sql语句问题 如何在java中导出mysql数据库 救助,解救,在线等待 新手求教!如何将文本导入MYSQL数据库表中 使用Latin1字符集写入中文报错 下载的MySQL源码怎么用 如何将数据窗口中的某一行锁定? 为什么order by 不起作用
Microsoft.Data.Odbc.OdbcConnection oODBCConnection;
string sConnString = "Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=test1;Uid=postgres;Pwd=chenqing5151!";
oODBCConnection = new OdbcConnection(sConnString);
try
{
oODBCConnection.Open();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
string strSQL = "select * from employees";
OdbcDataAdapter da = new OdbcDataAdapter(strSQL, oODBCConnection);
System.Data.DataSet ds = new System.Data.DataSet();
da.Fill(ds, "Employees");
dataGrid1.DataSource = ds.Tables["Employees"];需要包含什么头文件吗?
http://www.samool.com/archives/255/
有ODBC驱动及连接图例