Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: connection access problem


Message #1 by "Dan Crandell" <dan_c39@y...> on Tue, 22 Oct 2002 21:14:27
Hi all cant connect. Environment seems ok connection string?

<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>

<html>
  <head>
    <title>Connecting to an Access Database</title>
  </head>

  <body>
    <H3>Connecting to an Access Database</H3>
    <asp:DataGrid id="dgSuppliers" runat="server" />
  </body>
</html>

<script language="c#" runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
  String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
  OleDbConnection objConnection = new OleDbConnection(strConnection);

  String strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);

  objConnection.Open();
  dgSuppliers.DataSource = objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}
Message #2 by "Austin Lam" <ALam@a...> on Tue, 22 Oct 2002 16:20:37 -0400
you shoould use
  String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data
source=3DC:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"
 

you did put \\ and you should replace with  only one backslash and no 
semicolon after ther Double Quote



-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 5:14 PM
To: aspx_beginners
Subject: [aspx_beginners] connection access problem


Hi all cant connect. Environment seems ok connection string?

<%@ Import namespace=3D"System.Data" %>
<%@ Import namespace=3D"System.Data.OleDb" %>

<html>
  <head>
    <title>Connecting to an Access Database</title>
  </head>

  <body>
    <H3>Connecting to an Access Database</H3>
    <asp:DataGrid id=3D"dgSuppliers" runat=3D"server" />
  </body>
</html>

<script language=3D"c#" runat=3D"server">
private void Page_Load(object sender, System.EventArgs e)
{
  String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data
source=3DC:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
  OleDbConnection objConnection =3D new OleDbConnection(strConnection);

  String strSQL =3D "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand =3D new OleDbCommand(strSQL, objConnection);

  objConnection.Open();
  dgSuppliers.DataSource =3D objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #3 by Dan Crandell <dan_c39@y...> on Tue, 22 Oct 2002 13:25:45 -0700 (PDT)
I just tried this:
 String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);
 
Still not working :)
 Austin Lam <ALam@a...> wrote:you shoould use 
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"


you did put \\ and you should replace with only one backslash and no semicolon after ther Double Quote



-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 5:14 PM
To: aspx_beginners
Subject: [aspx_beginners] connection access problem


Hi all cant connect. Environment seems ok connection string?










Connecting to an Access Database





private void Page_Load(object sender, System.EventArgs e)
{
  String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
  OleDbConnection objConnection = new OleDbConnection(strConnection);

  String strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);

  objConnection.Open();
  dgSuppliers.DataSource = objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
Message #4 by "Austin Lam" <ALam@a...> on Tue, 22 Oct 2002 16:30:20 -0400
Hi

Just try this again

String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\7418BegASPNETdbCS\datastores\Northwind.mdb;"
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

I just took out \after C

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 4:26 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I just tried this:
 String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

Still not working :)
 Austin Lam <ALam@a...> wrote:you shoould use
String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data
source=3DC:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"


you did put \\ and you should replace with only one backslash and no 
semicolon after ther Double Quote



-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 5:14 PM
To: aspx_beginners
Subject: [aspx_beginners] connection access problem


Hi all cant connect. Environment seems ok connection string?










Connecting to an Access Database





private void Page_Load(object sender, System.EventArgs e)
{
  String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data
source=3DC:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
  OleDbConnection objConnection =3D new OleDbConnection(strConnection);

  String strSQL =3D "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand =3D new OleDbCommand(strSQL, objConnection);

  objConnection.Open();
  dgSuppliers.DataSource =3D objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #5 by Dan Crandell <dan_c39@y...> on Tue, 22 Oct 2002 13:41:54 -0700 (PDT)
Sorry for the pain but that too does not work?  here is entire page.  I do get the html portion though.     Connecting to an Access
Database
 
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>
<html>
  <head>
    <title>Connecting to an Access Database</title>
  </head>
  <body>
    <H3>Connecting to an Access Database</H3>
    <asp:DataGrid id="dgSuppliers" runat="server" />
  </body>
</html>
<script language="c#" runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

  String strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);
  objConnection.Open();
  dgSuppliers.DataSource = objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}
</script>

 
private void Page_Load(object sender, System.EventArgs e){String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data
source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb;" OleDbConnection objConnection = new OleDbConnection(strConnection);  String
strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";  OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection); 
objConnection.Open();  dgSuppliers.DataSource = objCommand.ExecuteReader();  dgSuppliers.DataBind();  objConnection.Close();}
 Austin Lam <ALam@a...> wrote:Hi

Just try this again

String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

I just took out \after C

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 4:26 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I just tried this:
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

Still not working :)
Austin Lam wrote:you shoould use 
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"


you did put \\ and you should replace with only one backslash and no semicolon after ther Double Quote



-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 5:14 PM
To: aspx_beginners
Subject: [aspx_beginners] connection access problem


Hi all cant connect. Environment seems ok connection string?










Connecting to an Access Database





private void Page_Load(object sender, System.EventArgs e)
{
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
OleDbConnection objConnection = new OleDbConnection(strConnection);

String strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";
OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);

objConnection.Open();
dgSuppliers.DataSource = objCommand.ExecuteReader();
dgSuppliers.DataBind();
objConnection.Close();
}
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
Message #6 by "Peter Lanoie" <planoie@n...> on Tue, 22 Oct 2002 16:51:08 -0400
Dan, 

Why not post the error you are getting so we may see what the problem is.

Peter
Message #7 by "Austin Lam" <ALam@a...> on Tue, 22 Oct 2002 16:55:32 -0400
hi

Are you using VB.NET or C#

I think is just the synax error like ;

if you are using VB.net rather than c#

you do not have to put hte ; at the end of each line of code

if you are using c#
Just Double check all lines again

Pls let me know the result

Austin

String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\7418BegASPNETdbCS\datastores\Northwind.mdb"
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 4:42 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



Sorry for the pain but that too does not work?  here is entire page.  I 
do get the html portion though.     Connecting to an Access Database

<%@ Import namespace=3D"System.Data" %>
<%@ Import namespace=3D"System.Data.OleDb" %>
<html>
  <head>
    <title>Connecting to an Access Database</title>
  </head>
  <body>
    <H3>Connecting to an Access Database</H3>
    <asp:DataGrid id=3D"dgSuppliers" runat=3D"server" />
  </body>
</html>
<script language=3D"c#" runat=3D"server">
private void Page_Load(object sender, System.EventArgs e)
{
String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\7418BegASPNETdbCS\datastores\Northwind.mdb;"
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

  String strSQL =3D "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand =3D new OleDbCommand(strSQL, objConnection);
  objConnection.Open();
  dgSuppliers.DataSource =3D objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}
</script>


private void Page_Load(object sender, System.EventArgs e){String 
strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\7418BegASPNETdbCS\datastores\Northwind.mdb;" OleDbConnection 
objConnection =3D new OleDbConnection(strConnection);  String strSQL =3D 
"SELECT SupplierID, CompanyName FROM Suppliers";  OleDbCommand 
objCommand =3D new OleDbCommand(strSQL, objConnection);  
objConnection.Open();  dgSuppliers.DataSource =3D 
objCommand.ExecuteReader();  dgSuppliers.DataBind();  
objConnection.Close();}
 Austin Lam <ALam@a...> wrote:Hi

Just try this again

String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\7418BegASPNETdbCS\datastores\Northwind.mdb;"
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

I just took out \after C

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 4:26 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I just tried this:
String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data 
source=3DC:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

Still not working :)
Austin Lam wrote:you shoould use
String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data
source=3DC:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"


you did put \\ and you should replace with only one backslash and no 
semicolon after ther Double Quote



-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 5:14 PM
To: aspx_beginners
Subject: [aspx_beginners] connection access problem


Hi all cant connect. Environment seems ok connection string?










Connecting to an Access Database





private void Page_Load(object sender, System.EventArgs e)
{
String strConnection =3D "Provider=3DMicrosoft.Jet.OleDb.4.0; data
source=3DC:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
OleDbConnection objConnection =3D new OleDbConnection(strConnection);

String strSQL =3D "SELECT SupplierID, CompanyName FROM Suppliers";
OleDbCommand objCommand =3D new OleDbCommand(strSQL, objConnection);

objConnection.Open();
dgSuppliers.DataSource =3D objCommand.ExecuteReader();
dgSuppliers.DataBind();
objConnection.Close();
}
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=3D1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=3D1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.
Message #8 by Dan Crandell <dan_c39@y...> on Tue, 22 Oct 2002 14:06:07 -0700 (PDT)
I am getting no error at all.  I just get the html that is in the file.
 Peter Lanoie <planoie@n...> wrote:Dan, 

Why not post the error you are getting so we may see what the problem is.

Peter

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
Message #9 by Dan Crandell <dan_c39@y...> on Tue, 22 Oct 2002 14:06:39 -0700 (PDT)
Using c#
 
 Austin Lam <ALam@a...> wrote:hi

Are you using VB.NET or C#

I think is just the synax error like ;

if you are using VB.net rather than c#

you do not have to put hte ; at the end of each line of code

if you are using c#
Just Double check all lines again

Pls let me know the result

Austin

String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 4:42 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



Sorry for the pain but that too does not work? here is entire page. I do get the html portion though. Connecting to an Access
Database








Connecting to an Access Database




private void Page_Load(object sender, System.EventArgs e)
{
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

  String strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";
  OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);
  objConnection.Open();
  dgSuppliers.DataSource = objCommand.ExecuteReader();
  dgSuppliers.DataBind();
  objConnection.Close();
}



private void Page_Load(object sender, System.EventArgs e){String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data
source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb;" OleDbConnection objConnection = new OleDbConnection(strConnection); String
strSQL = "SELECT SupplierID, CompanyName FROM Suppliers"; OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);
objConnection.Open(); dgSuppliers.DataSource = objCommand.ExecuteReader(); dgSuppliers.DataBind(); objConnection.Close();}
Austin Lam wrote:Hi

Just try this again

String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

I just took out \after C

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 4:26 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I just tried this:
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data source=C:\\7418BegASPNETdbCS\datastores\Northwind.mdb;" 
OleDbConnection objConnection = new OleDbConnection(strConnection);

Still not working :)
Austin Lam wrote:you shoould use 
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\datastores\Northwind.mdb;"


you did put \\ and you should replace with only one backslash and no semicolon after ther Double Quote



-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 5:14 PM
To: aspx_beginners
Subject: [aspx_beginners] connection access problem


Hi all cant connect. Environment seems ok connection string?










Connecting to an Access Database





private void Page_Load(object sender, System.EventArgs e)
{
String strConnection = "Provider=Microsoft.Jet.OleDb.4.0; data 
source=C:\\7418BegASPNETdbCS\\datastores\\Northwind.mdb;";
OleDbConnection objConnection = new OleDbConnection(strConnection);

String strSQL = "SELECT SupplierID, CompanyName FROM Suppliers";
OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);

objConnection.Open();
dgSuppliers.DataSource = objCommand.ExecuteReader();
dgSuppliers.DataBind();
objConnection.Close();
}
---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET 
applications. Requiring some basic knowledge of ASP.NET, 
Access and SQL the authors guide you through the process 
of connecting and consuming information in a variety of 
ways. They are packed full of excellent illustrative code 
examples, demonstrating important fundamental principles.

---
Beginning ASP.NET Databases using VB.NET
http://www.wrox.com/ACON11.asp?ISBN=1861006195

Beginning ASP.NET Databases using C#
http://www.wrox.com/ACON11.asp?ISBN=1861007418

These books look at how we can create data-centric ASP.NET
applications. Requiring some basic knowledge of ASP.NET,
Access and SQL the authors guide you through the process
of connecting and consuming information in a variety of
ways. They are packed full of excellent illustrative code
examples, demonstrating important fundamental principles.


---------------------------------
Do You Yahoo!?
Yahoo! Health - Feel better, live better
Message #10 by "Peter Lanoie" <planoie@n...> on Wed, 23 Oct 2002 08:33:12 -0400
Dan,

You're getting only the HTML that's in the file?  Is any code running?  I
see no reason that you wouldn't get an error message from faulty code (if
any) unless the code isn't even executing.  It almost sounds like you have a
server configuration issue.

In the browser, are you seeing the HTML from your ASPX form, like literally
what's in the ASPX file?  Can you confirm that the page_load is actually
executing?

This is beginning to sound less like a code problem and more a setup issue.

Peter

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 17:06
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I am getting no error at all.  I just get the html that is in the file.
 Peter Lanoie <planoie@n...> wrote:Dan,

Why not post the error you are getting so we may see what the problem is.

Peter


Message #11 by "Dan Crandell" <dan_c39@y...> on Wed, 23 Oct 2002 19:19:29
> Dan,

You're getting only the HTML that's in the file?  Is any code running?  I
see no reason that you wouldn't get an error message from faulty code (if
any) unless the code isn't even executing.  It almost sounds like you have 
a
server configuration issue.

In the browser, are you seeing the HTML from your ASPX form, like literally
what's in the ASPX file?  Can you confirm that the page_load is actually
executing?

This is beginning to sound less like a code problem and more a setup issue.

Peter

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 17:06
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I am getting no error at all.  I just get the html that is in the file.
 Peter Lanoie <planoie@n...> wrote:Dan,

Why not post the error you are getting so we may see what the problem is.

Peter


Message #12 by "Dan Crandell" <dan_c39@y...> on Wed, 23 Oct 2002 19:21:07
Yes I agree.  I do see the html but no datagrid stuff?  when I view source 
I see all the correct code in it.

At home I set all this up and it works fine.  So I know it is not the 
code. However at work I setup the same way and can not get things to work.



> Dan,

You're getting only the HTML that's in the file?  Is any code running?  I
see no reason that you wouldn't get an error message from faulty code (if
any) unless the code isn't even executing.  It almost sounds like you have 
a
server configuration issue.

In the browser, are you seeing the HTML from your ASPX form, like literally
what's in the ASPX file?  Can you confirm that the page_load is actually
executing?

This is beginning to sound less like a code problem and more a setup issue.

Peter

-----Original Message-----
From: Dan Crandell [mailto:dan_c39@y...]
Sent: Tuesday, October 22, 2002 17:06
To: aspx_beginners
Subject: [aspx_beginners] RE: connection access problem



I am getting no error at all.  I just get the html that is in the file.
 Peter Lanoie <planoie@n...> wrote:Dan,

Why not post the error you are getting so we may see what the problem is.

Peter



  Return to Index