iLLfLiP
04-11-2008, 03:48 PM
Hi, I created a search application (using VWD 2008 express) that is trying to return results from a MS Access database. After I compile it, I am prompted with the following error in my browser:
Server Error in '/AccessFormDW' Application.
--------------------------------------------------------------------------------
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: CS1061: 'ASP.search_aspx' does not contain a definition for 'AccessDataSource1_Selecting' and no extension method 'AccessDataSource1_Selecting' accepting a first argument of type 'ASP.search_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 58: </asp:GridView>
Line 59:
Line 60: <asp:AccessDataSource
Line 61: ID="AccessDataSource1"
Line 62: runat="server"
Source File: c:\Documents and Settings\compname\My Documents\Visual Studio 2008\WebSites\AccessFormDW\search.aspx Line: 60
I have never come across this problem before and have not found any relevant information on the web. Below is my code:
<%@ Page Language="C#" Title="YOW Inventory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title id="search" runat="server">YOW Inventory Search</title>
<style type="text/css">
body, input{font-family: Arial, Helvetica, sans-serif;}
body {font-size:76%;}
input{font-size:100%;}
.label{float:left; width:80px;text-align:right;padding-right:5px;}
.row{clear:both}
</style>
</head>
<body>
<div class="row">
<span class="label">YOW_Item_No: </span>
<asp:TextBox ID="txtYOW_Item_No" runat="server" />
</div>
<div class="row">
<span class="label">YOW_Model_No: </span>
<asp:TextBox ID="txtYOW_Model_No" runat="server" />
</div>
<div class="row">
<span class="label">YOW_Model_Description: </span>
<asp:TextBox ID="txtYOW_Model_Description" runat="server" />
</div>
<div class="row">
<span class="label">YOW_Vendor_ID: </span>
<asp:TextBox ID="txtYOW_Vendor_ID" runat="server" />
</div>
<div class="row">
<span class="label"> </span>
<asp:Button ID="Button1" runat="server" Text="Search" />
</div>
<br />
<asp:GridView
ID="GridView1"
runat="server"
DataSourceID="AccessDataSource1"
AllowPaging="True"
PageSize="5" AutoGenerateColumns="False" >
<Columns>
<asp:BoundField DataField="YOW_Item_No" HeaderText="YOW_Item_No"
SortExpression="YOW_Item_No" />
<asp:BoundField DataField="YOW_Model_No" HeaderText="YOW_Model_No"
SortExpression="YOW_Model_No" />
<asp:BoundField DataField="YOW_Model_Description"
HeaderText="YOW_Model_Description" SortExpression="YOW_Model_Description" />
<asp:BoundField DataField="YOW_Vendor_ID" HeaderText="YOW_Vendor_ID"
SortExpression="YOW_Vendor_ID" />
</Columns>
</asp:GridView>
<asp:AccessDataSource
ID="AccessDataSource1"
runat="server"
DataFile="~/App_Data/InventoryDB2.mdb"
SelectCommand="SELECT YOW_Item_No, YOW_Model_No, YOW_Model_Description, YOW_Vendor_ID
FROM Inventory WHERE
(@YOW_Item_No IS NULL OR YOW_Item_No LIKE '%' + @YOW_Item_No + '%') AND
(@YOW_Model_No IS NULL OR YOW_Model_No LIKE '%' + @YOW_Model_No + '%') AND
(@YOW_Model_Description IS NULL OR YOW_Model_Description LIKE '%' + @YOW_Model_Description + '%') AND
(@YOW_Vendor_ID IS NULL OR YOW_Vendor_ID LIKE '%' + @YOW_Vendor_ID + '%');"
CancelSelectOnNullParameter="False"
OnSelecting="AccessDataSource1_Selecting">
<SelectParameters>
<asp:ControlParameter
ControlID="txtYOW_Item_No"
Name="YOW_Item_No"
Type="String" />
<asp:ControlParameter
ControlID="txtYOW_Model_No"
Name="YOW_Model_No"
Type="String" />
<asp:ControlParameter
ControlID="txtYOW_Model_Description"
Name="YOW_Model_Description"
Type="String" />
<asp:ControlParameter
ControlID="txtYOW_Vendor_ID"
Name="YOW_Vendor_ID"
Type="String" />
</SelectParameters>
</asp:AccessDataSource>
</body>
</html>
Anyone have any ideas??
Thanks in advance
Server Error in '/AccessFormDW' Application.
--------------------------------------------------------------------------------
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: CS1061: 'ASP.search_aspx' does not contain a definition for 'AccessDataSource1_Selecting' and no extension method 'AccessDataSource1_Selecting' accepting a first argument of type 'ASP.search_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 58: </asp:GridView>
Line 59:
Line 60: <asp:AccessDataSource
Line 61: ID="AccessDataSource1"
Line 62: runat="server"
Source File: c:\Documents and Settings\compname\My Documents\Visual Studio 2008\WebSites\AccessFormDW\search.aspx Line: 60
I have never come across this problem before and have not found any relevant information on the web. Below is my code:
<%@ Page Language="C#" Title="YOW Inventory" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title id="search" runat="server">YOW Inventory Search</title>
<style type="text/css">
body, input{font-family: Arial, Helvetica, sans-serif;}
body {font-size:76%;}
input{font-size:100%;}
.label{float:left; width:80px;text-align:right;padding-right:5px;}
.row{clear:both}
</style>
</head>
<body>
<div class="row">
<span class="label">YOW_Item_No: </span>
<asp:TextBox ID="txtYOW_Item_No" runat="server" />
</div>
<div class="row">
<span class="label">YOW_Model_No: </span>
<asp:TextBox ID="txtYOW_Model_No" runat="server" />
</div>
<div class="row">
<span class="label">YOW_Model_Description: </span>
<asp:TextBox ID="txtYOW_Model_Description" runat="server" />
</div>
<div class="row">
<span class="label">YOW_Vendor_ID: </span>
<asp:TextBox ID="txtYOW_Vendor_ID" runat="server" />
</div>
<div class="row">
<span class="label"> </span>
<asp:Button ID="Button1" runat="server" Text="Search" />
</div>
<br />
<asp:GridView
ID="GridView1"
runat="server"
DataSourceID="AccessDataSource1"
AllowPaging="True"
PageSize="5" AutoGenerateColumns="False" >
<Columns>
<asp:BoundField DataField="YOW_Item_No" HeaderText="YOW_Item_No"
SortExpression="YOW_Item_No" />
<asp:BoundField DataField="YOW_Model_No" HeaderText="YOW_Model_No"
SortExpression="YOW_Model_No" />
<asp:BoundField DataField="YOW_Model_Description"
HeaderText="YOW_Model_Description" SortExpression="YOW_Model_Description" />
<asp:BoundField DataField="YOW_Vendor_ID" HeaderText="YOW_Vendor_ID"
SortExpression="YOW_Vendor_ID" />
</Columns>
</asp:GridView>
<asp:AccessDataSource
ID="AccessDataSource1"
runat="server"
DataFile="~/App_Data/InventoryDB2.mdb"
SelectCommand="SELECT YOW_Item_No, YOW_Model_No, YOW_Model_Description, YOW_Vendor_ID
FROM Inventory WHERE
(@YOW_Item_No IS NULL OR YOW_Item_No LIKE '%' + @YOW_Item_No + '%') AND
(@YOW_Model_No IS NULL OR YOW_Model_No LIKE '%' + @YOW_Model_No + '%') AND
(@YOW_Model_Description IS NULL OR YOW_Model_Description LIKE '%' + @YOW_Model_Description + '%') AND
(@YOW_Vendor_ID IS NULL OR YOW_Vendor_ID LIKE '%' + @YOW_Vendor_ID + '%');"
CancelSelectOnNullParameter="False"
OnSelecting="AccessDataSource1_Selecting">
<SelectParameters>
<asp:ControlParameter
ControlID="txtYOW_Item_No"
Name="YOW_Item_No"
Type="String" />
<asp:ControlParameter
ControlID="txtYOW_Model_No"
Name="YOW_Model_No"
Type="String" />
<asp:ControlParameter
ControlID="txtYOW_Model_Description"
Name="YOW_Model_Description"
Type="String" />
<asp:ControlParameter
ControlID="txtYOW_Vendor_ID"
Name="YOW_Vendor_ID"
Type="String" />
</SelectParameters>
</asp:AccessDataSource>
</body>
</html>
Anyone have any ideas??
Thanks in advance