I've got a simple (I think) asp.net application.
I've created a DataSet in App_Code/ItemDataSet.xsd . Tested connection,
seemed to work fine.
In my ASPX file, I first dropped an ObjectDataSourc e onto the form, and
pointed it to the dataset created above.
I then dropped a GridView on the form, and selected the ObjectDataSourc e
I created above. In the Design view it seems to be at least loading the
columns (if not the data) correctly.
When I try to access on the server, I am getting the following error
(full stack trace at bottom of message):
[InvalidOperatio nException: The type specified in the TypeName property
of ObjectDataSourc e 'ObjectDataSour ce1' could not be found.]
Thanks for any insight.
here is my aspx code:
<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt.aspx.cs"
Inherits="admin _Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Molone y Store</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ObjectData Source ID="ObjectDataS ource1" runat="server"
DeleteMethod="D elete"
InsertMethod="I nsert"
OldValuesParame terFormatString ="original_{ 0}" SelectMethod="G etData"
TypeName="ItemD ataSetTableAdap ters.STORE2_ITE MTableAdapter"
UpdateMethod="U pdate">
<DeleteParamete rs>
<asp:Paramete r Name="Original_ id" Type="Int32" />
</DeleteParameter s>
<UpdateParamete rs>
<asp:Paramete r Name="host_id" Type="Int32" />
<asp:Paramete r Name="sku" Type="String" />
<asp:Paramete r Name="name" Type="String" />
<asp:Paramete r Name="price" Type="Decimal" />
<asp:Paramete r Name="descripti on" Type="String" />
<asp:Paramete r Name="featured" Type="Boolean" />
<asp:Paramete r Name="popularit y" Type="Int32" />
<asp:Paramete r Name="taxRate" Type="Decimal" />
<asp:Paramete r Name="Original_ id" Type="Int32" />
<asp:Paramete r Name="id" Type="Int32" />
</UpdateParameter s>
<InsertParamete rs>
<asp:Paramete r Name="host_id" Type="Int32" />
<asp:Paramete r Name="sku" Type="String" />
<asp:Paramete r Name="name" Type="String" />
<asp:Paramete r Name="price" Type="Decimal" />
<asp:Paramete r Name="descripti on" Type="String" />
<asp:Paramete r Name="featured" Type="Boolean" />
<asp:Paramete r Name="popularit y" Type="Int32" />
<asp:Paramete r Name="taxRate" Type="Decimal" />
</InsertParameter s>
</asp:ObjectDataS ource>
<as p:GridView ID="GridView1" runat="server"
AutoGenerateCol umns="False"
DataKeyNames="i d" DataSourceID="O bjectDataSource 1">
<Columns>
<asp:BoundFie ld DataField="id" HeaderText="id"
InsertVisible=" False" ReadOnly="True"
SortExpression= "id" />
<asp:BoundFie ld DataField="host _id"
HeaderText="hos t_id" SortExpression= "host_id" />
<asp:BoundFie ld DataField="sku" HeaderText="sku "
SortExpression= "sku" />
<asp:BoundFie ld DataField="name " HeaderText="nam e"
SortExpression= "name" />
<asp:BoundFie ld DataField="pric e" HeaderText="pri ce"
SortExpression= "price" />
<asp:BoundFie ld DataField="desc ription"
HeaderText="des cription" SortExpression= "descriptio n" />
<asp:CheckBoxFi eld DataField="feat ured"
HeaderText="fea tured" SortExpression= "featured" />
<asp:BoundFie ld DataField="popu larity"
HeaderText="pop ularity" SortExpression= "popularity " />
<asp:BoundFie ld DataField="taxR ate"
HeaderText="tax Rate" SortExpression= "taxRate" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
and the full text of the stack trace:
[InvalidOperatio nException: The type specified in the TypeName property
of ObjectDataSourc e 'ObjectDataSour ce1' could not be found.]
System.Web.UI.W ebControls.Obje ctDataSourceVie w.GetType(Strin g
typeName) +1261639
System.Web.UI.W ebControls.Obje ctDataSourceVie w.ExecuteSelect (DataSourceSele ctArguments
arguments) +1936
System.Web.UI.D ataSourceView.S elect(DataSourc eSelectArgument s
arguments, DataSourceViewS electCallback callback) +17
System.Web.UI.W ebControls.Data BoundControl.Pe rformSelect() +149
System.Web.UI.W ebControls.Base DataBoundContro l.DataBind() +70
System.Web.UI.W ebControls.Grid View.DataBind() +4
System.Web.UI.W ebControls.Base DataBoundContro l.EnsureDataBou nd() +82
System.Web.UI.W ebControls.Comp ositeDataBoundC ontrol.CreateCh ildControls()
+69
System.Web.UI.C ontrol.EnsureCh ildControls() +87
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +41
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +161
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.507 27.42;
ASP.NET Version:2.0.507 27.210