T
Tao Lei
Please:
I wrote these lines of codes of ASP.Net. But it goes wrong.
Why??? Who can help me?
Thank you very much!!!
<% @Page Language="C#"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>
<html>
<head>
<Script runat="server">
void page_Load(Object Source, EventArgs E)
{
string strSQL="select * from TEST";
string strconn="Provider=MSDASQL.1;Persist Security Info=false;Data
Source=TEST_ACCESS";
OdbcConnection conn = new OdbcConnection(strconn);
OdbcDataAdapter adp = new OdbcDataAdapter(strSQL, conn);
DataSet ds = new DataSet();
adp.Fill(ds, "TEST");
DG1.DataSource = ds.Tables["TEST"];
DG1.DataBind();
}
</Script>
</head>
<body>
<center>
<asp:datagrid id="DG1" runat="server" />
</center>
The exception information are here
System.Data.Odbc.OdbcException : ERROR [IM002] [Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified
I wrote these lines of codes of ASP.Net. But it goes wrong.
Why??? Who can help me?
Thank you very much!!!
<% @Page Language="C#"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>
<html>
<head>
<Script runat="server">
void page_Load(Object Source, EventArgs E)
{
string strSQL="select * from TEST";
string strconn="Provider=MSDASQL.1;Persist Security Info=false;Data
Source=TEST_ACCESS";
OdbcConnection conn = new OdbcConnection(strconn);
OdbcDataAdapter adp = new OdbcDataAdapter(strSQL, conn);
DataSet ds = new DataSet();
adp.Fill(ds, "TEST");
DG1.DataSource = ds.Tables["TEST"];
DG1.DataBind();
}
</Script>
</head>
<body>
<center>
<asp:datagrid id="DG1" runat="server" />
</center>
The exception information are here
System.Data.Odbc.OdbcException : ERROR [IM002] [Microsoft][ODBC Driver
Manager] Data source name not found and no default driver specified