链接代码如下
using System;
using SystemData;
using SystemConfiguration;
using SystemWeb;
using SystemWebSecurity;
using SystemWebUI;
using SystemWebUIWebControls;
using SystemWebUIWebControlsWebParts;
using SystemWebUIHtmlControls;
using SystemDataOdbc;
public partial class _Default : SystemWebUIPage
{
protected void Page_Load(object sender EventArgs e)
{
}
protected void Button_Click(object sender EventArgs e)
{
OdbcConnection oc = new OdbcConnection(Dsn=jb;uid=sa;pwd=;);
try
{
ocOpen();
OdbcDataAdapter OD = new OdbcDataAdapter(SELECT * from jobs oc);
DataSet ds = new DataSet();
ODFill(ds);
GridViewDataSource = ds;
GridViewDataBind();
ResponseWrite(<script language=javascript>alert(ODBC数据源连接成功!)</script>);
}
catch
{
ResponseWrite(<script language=javascript>alert(ODBC数据源连接失败!)</script>);
}
}
}