This is the error that I am getting. I tried to fix this error and do not know where else to fix this. This is what it came up on IE.
You can find "Northwind.mdb" off the internet. Make sure to rename it to Nwind.mdb as the program reads it to open. I have to use the orders table and display customers name and freight prices. I also need to change the connections string.
Syntax error in FROM clause. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Syntax error in FROM clause.
Source Error:
Line 29: //Create a data reader which will read each record from the select
Line 30: //command in a forward-only, read-only mode
Line 31: OleDbDataReader rdr = cmd.ExecuteReader();Line 32:
Line 33: //Loop for every record
Even with the updated code:
try{
catch (InvalidOperationException e) {
//error handling for an already open connection
//examine e.HResult, e.Message
}
catch (OleDbException e) {
foreach(OleDbError err in e.Errors) {
//examine e.Number, e.Message
}
}
catch (Exception e) {
//general error handling
}
if (con != null) {
//code to work with a valid databaseconnection
}
It gave me 2 errors. 
CODE
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server" Language="C#">
private String _TableName;
public String TableName {
get {
return _TableName;
}
set {
_TableName = value;
}
}
</script>
<%
//Create a connection to the local NorthWind database
OleDbConnection con =
new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Users\\Julius\\Desktop\\Nwind.mdb;" +
"User ID=;Password=;");
con.Open(); [quote]<==== The problem is here.[/quote]
//Create a simple command that will select every record from a table
OleDbCommand cmd = new OleDbCommand("Select * from " + _TableName, con);
//Create a data reader which will read each record from the select
//command in a forward-only, read-only mode
OleDbDataReader rdr = cmd.ExecuteReader();
//Loop for every record
while(rdr.Read()) {
//Loop through every column - 0 to FieldCount
for( int fldNum = 0; fldNum < rdr.FieldCount; fldNum++ ) {
String strFieldItem = "";
//If the value in the column is not null, retrieve it as
//a String value
if(!rdr.IsDBNull(fldNum)) {
strFieldItem = rdr.GetString(fldNum);
}
//Write out the value
Response.Write(strFieldItem);
if (fldNum < rdr.FieldCount - 1)
Response.Write(", ");
else
Response.Write("<br>");
}
}
//Close the data reader and the connection - no need to close
//the command object
rdr.Close();
con.Close();
%>
This post has been edited by pcnote: 5 Jul, 2008 - 09:59 AM