<%@ Import Namespace="System.Data.OleDb" %>
<script language="C#" runat="server">
//Global Variables
OleDbConnection Conn;
void DBConnect(String SQL, String DB) {
OleDbCommand Cmd;
String Provider = "Provider=Microsoft.Jet.OLEDB.4.0";
String Database = "Data Source=" + Server.MapPath(Db);
Conn = New OleDbConnection (Provider + ";" + Database) ;
Conn.open();
Cmd = New OleDbCommand(SQL,Conn);
Return Cmd.ExecuteReader();
}
void CloseConn() {
Conn.close();
}
</script>
I got the error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1002: ; expected
Source Error:
Line 8: String Provider = "Provider=Microsoft.Jet.OLEDB.4.0";
Line 9: String Database = "Data Source=" + Server.MapPath(Db);
Line 10: Conn = New OleDbConnection (Provider + ";" + Database) ;
Line 11: Conn.open();
Line 12: Cmd = New OleDbCommand(SQL,Conn);