A
Aries
I have a connection string like this, anyone know how can I fix it?
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<body>
<!-- #include file = "linkx.inc" -->
<script language="C#" runat="server">
protected void Page_Load(Object sender, EventArgs e)
{
string mysql;
OleDbConnection myConnection = new OleDbConnection();
myConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\inetpub\\wwwroot\\break.mdb;";
mysql = "SELECT Date, Build, Count(*) as num FROM BVTbreak GROUP BY Date,
Build where status = 5 order by Build DESC;";
OleDbDataAdapter myCommand = OleDbDataAdapter(mysql, myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "Waive");
MyDataGrid.DataSource=ds.Tables["Waive"].DefaultView;
MyDataGrid.DataBind();
}
I got the compilation error:
Line 18: OleDbAdapter myCommand = OleDbAdapter(mysql, myConnection);
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<body>
<!-- #include file = "linkx.inc" -->
<script language="C#" runat="server">
protected void Page_Load(Object sender, EventArgs e)
{
string mysql;
OleDbConnection myConnection = new OleDbConnection();
myConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=c:\\inetpub\\wwwroot\\break.mdb;";
mysql = "SELECT Date, Build, Count(*) as num FROM BVTbreak GROUP BY Date,
Build where status = 5 order by Build DESC;";
OleDbDataAdapter myCommand = OleDbDataAdapter(mysql, myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "Waive");
MyDataGrid.DataSource=ds.Tables["Waive"].DefaultView;
MyDataGrid.DataBind();
}
I got the compilation error:
Line 18: OleDbAdapter myCommand = OleDbAdapter(mysql, myConnection);