当前位置: 移动技术网 > IT编程>开发语言>c# > C#连接ODBC数据源的方法

C#连接ODBC数据源的方法

2019年07月18日  | 移动技术网IT编程  | 我要评论
本文实例讲述了c#连接odbc数据源的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:// namespaces, variables, and co

本文实例讲述了c#连接odbc数据源的方法。分享给大家供大家参考。具体实现方法如下:

复制代码 代码如下:
// namespaces, variables, and constants
using system;
using system.configuration;
using system.data;
using system.data.odbc;
private void cbutton_click(object sender, system.eventargs e)
{
    // create the dataadapter.
    string sql = "select id, name from products";
    odbcdataadapter da = new odbcdataadapter(sql,configurationsettings.appsettings["connectionstring1"]);
    // create the table, fill it, and bind the default view to the grid.
    datatable dt = new datatable( );
    da.fill(dt);
}

希望本文所述对大家的c#程序设计有所帮助。

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网