Ah, underbart med snabba svar. Min kod ser nu ut som följer:
Kod:
<%@ Import Namespace="System.Data.OleDb" %>
<%
string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db.mdb;User Id=admin;Password=;";
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from tblEvent";
OleDbConnection conn = new OleDbConnection(connStr);
try
{
conn.Open(); // Öppna mot databasen
cmd.Connection = conn;
dataGrid.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection);
dataGrid.DataBind();
}
catch(Exception ex)
{
}%>
Jag får då felet
Kod:
Compiler Error Message: CS0246: The type or namespace name 'CommandType' could not be found (are you missing a using directive or an assembly reference?)
Har jag missat att inkludera någon referens?