I am trying to create a website on (visual studio) and connect it to database(Microsoft sql server 2014) first I am learning from a video on youtube the tutorial is about a coffee website and database
I have a few errors but I dont know where is the problem
the errors in this page(Coffee.aspx.cs)
Error 1 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\Users\Ziyad 1\Documents\Visual Studio
2013\WebSites\MyWebsite\Pages\Coffee.aspx.cs 7 33 MyWebsite
Error 4 'ASP.pages_coffee_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\Users\Ziyad 1\AppData\Local\Temp\Temporary ASP.NET Files\root\e78a0b4c\be391a08\App_Web_k4b10ys2.0.cs 572
Error 3 'ASP.pages_coffee_aspx.GetTypeHashCode()': no suitable method found to override c:\Users\Ziyad 1\AppData\Local\Temp\Temporary ASP.NET Files\root\e78a0b4c\be391a08\App_Web_k4b10ys2.0.cs 567
Error 5 'ASP.pages_coffee_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\Users\Ziyad 1\AppData\Local\Temp\Temporary ASP.NET Files\root\e78a0b4c\be391a08\App_Web_k4b10ys2.0.cs 185
and here is the page (Coffee.aspx.cs) code
usingSystem;usingSystem.Collections;usingSystem.Text;namespacePages{publicpartialclassPages_Coffee:System.Web.UI.Page{protectedvoidPage_Load(object sender,EventArgs e){FillPage();}privatevoidFillPage(){ArrayList coffeeList =ConnectionClass.GetCoffeeByType(DropDownList1.SelectedValue);StringBuilder sb =newStringBuilder();foreach(Coffee coffee in coffeeList){
sb.Append(string.Format(@"<table class='coffeeTable'><tr><th rowspan='6' width='150px'><img runat='server' src='{6}' /></th><th width='50px'>Name: </td><td>{0}</td></tr><tr><th>Type: </th><td>{1}</td></tr><tr><th>Price: </th><td>{2} $</td></tr><tr><th>Roast: </th><td>{3}</td></tr><tr><th>Origin: </th><td>{4}</td></tr><tr><td colspan='2'>{5}</td></tr> </table>", coffee.Name, coffee.Type, coffee.Price, coffee.Roast, coffee.Country, coffee.Review, coffee.Image));
lblOuput.Text= sb.ToString();}}protectedvoidDropDownList1_SelectedIndexChanged(object sender,EventArgs e){FillPage();}}}
also tis is the page (Coffee.aspx)code
<%@PageTitle=""Language="C#"MasterPageFile="~/Masterpage.master"AutoEventWireup="true"CodeFile="Coffee.aspx.cs"Inherits="Coffee" %><scriptrunat="server">protectedvoidDropDownList1_SelectedIndexChanged(object sender,EventArgs e){}</script><asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server"><p>
Select a type:<asp:DropDownListID="DropDownList1"runat="server"AutoPostBack="True"DataSourceID="sds_type"DataTextField="type"DataValueField="type"OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList><asp:SqlDataSource ID="sds_type" runat="server" ConnectionString="<%$ ConnectionStrings:CoffeeDBConnectionString %>" SelectCommand="SELECT DISTINCT [type] FROM [coffee] ORDER BY [type]"></asp:SqlDataSource></p><p><asp:LabelID="lblOutput"runat="server"Text="Label"></asp:Label></p></asp:Content>
this is th (ConnectionClass.cs)code
(web.confg)code
and finally this is the SQL code
|
I am still a beginner ~~ I need to understand what are these errors and how to solve them