插入数据问题!!
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script Language="c#" runat="server">
void Page_Load(object sender, EventArgs e)
{
OleDbConnection objConnection = null;
OleDbCommand objCmd = null;
string strConnection, strSQL;
strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";
strConnection += @"Data Source=\\genfs1\www11\etning\xml\Northwind.mdb";
// Create and open the connection object
objConnection = new OleDbConnection(strConnection);
objConnection.Open();
// Set the SQL string
strSQL = "INSERT INTO Employees ( FirstName , LastName, Title )" + " VALUES ( 'etning' , 'meng','my name is etning' )";
// Create the Command and set its properties
objCmd = new OleDbCommand(strSQL, objConnection);
// Execute the command
objCmd.ExecuteNonQuery();
lblStatus.Text = "Command run";
}
</script>
<html>
<body>
<h2>Using SQL directly</h2>
<asp:Label id="lblStatus" runat="server"/>
</body>
</html>
代码无法运行,请教各位高手,怎么办才对呢?