B
Bryce Fischer
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 ObjectDataSource onto the form, and
pointed it to the dataset created above.
I then dropped a GridView on the form, and selected the ObjectDataSource
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):
[InvalidOperationException: The type specified in the TypeName property
of ObjectDataSource 'ObjectDataSource1' could not be found.]
Thanks for any insight.
here is my aspx code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="admin_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Moloney Store</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DeleteMethod="Delete"
InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="ItemDataSetTableAdapters.STORE2_ITEMTableAdapter"
UpdateMethod="Update">
<DeleteParameters>
<asp
arameter Name="Original_id" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp
arameter Name="host_id" Type="Int32" />
<asp
arameter Name="sku" Type="String" />
<asp
arameter Name="name" Type="String" />
<asp
arameter Name="price" Type="Decimal" />
<asp
arameter Name="description" Type="String" />
<asp
arameter Name="featured" Type="Boolean" />
<asp
arameter Name="popularity" Type="Int32" />
<asp
arameter Name="taxRate" Type="Decimal" />
<asp
arameter Name="Original_id" Type="Int32" />
<asp
arameter Name="id" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp
arameter Name="host_id" Type="Int32" />
<asp
arameter Name="sku" Type="String" />
<asp
arameter Name="name" Type="String" />
<asp
arameter Name="price" Type="Decimal" />
<asp
arameter Name="description" Type="String" />
<asp
arameter Name="featured" Type="Boolean" />
<asp
arameter Name="popularity" Type="Int32" />
<asp
arameter Name="taxRate" Type="Decimal" />
</InsertParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
DataKeyNames="id" DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="id" HeaderText="id"
InsertVisible="False" ReadOnly="True"
SortExpression="id" />
<asp:BoundField DataField="host_id"
HeaderText="host_id" SortExpression="host_id" />
<asp:BoundField DataField="sku" HeaderText="sku"
SortExpression="sku" />
<asp:BoundField DataField="name" HeaderText="name"
SortExpression="name" />
<asp:BoundField DataField="price" HeaderText="price"
SortExpression="price" />
<asp:BoundField DataField="description"
HeaderText="description" SortExpression="description" />
<asp:CheckBoxField DataField="featured"
HeaderText="featured" SortExpression="featured" />
<asp:BoundField DataField="popularity"
HeaderText="popularity" SortExpression="popularity" />
<asp:BoundField DataField="taxRate"
HeaderText="taxRate" SortExpression="taxRate" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
and the full text of the stack trace:
[InvalidOperationException: The type specified in the TypeName property
of ObjectDataSource 'ObjectDataSource1' could not be found.]
System.Web.UI.WebControls.ObjectDataSourceView.GetType(String
typeName) +1261639
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments
arguments) +1936
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
+69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210
I've created a DataSet in App_Code/ItemDataSet.xsd. Tested connection,
seemed to work fine.
In my ASPX file, I first dropped an ObjectDataSource onto the form, and
pointed it to the dataset created above.
I then dropped a GridView on the form, and selected the ObjectDataSource
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):
[InvalidOperationException: The type specified in the TypeName property
of ObjectDataSource 'ObjectDataSource1' could not be found.]
Thanks for any insight.
here is my aspx code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="admin_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Moloney Store</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DeleteMethod="Delete"
InsertMethod="Insert"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="ItemDataSetTableAdapters.STORE2_ITEMTableAdapter"
UpdateMethod="Update">
<DeleteParameters>
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
</DeleteParameters>
<UpdateParameters>
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
</UpdateParameters>
<InsertParameters>
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
<asp
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
</InsertParameters>
</asp:ObjectDataSource>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
DataKeyNames="id" DataSourceID="ObjectDataSource1">
<Columns>
<asp:BoundField DataField="id" HeaderText="id"
InsertVisible="False" ReadOnly="True"
SortExpression="id" />
<asp:BoundField DataField="host_id"
HeaderText="host_id" SortExpression="host_id" />
<asp:BoundField DataField="sku" HeaderText="sku"
SortExpression="sku" />
<asp:BoundField DataField="name" HeaderText="name"
SortExpression="name" />
<asp:BoundField DataField="price" HeaderText="price"
SortExpression="price" />
<asp:BoundField DataField="description"
HeaderText="description" SortExpression="description" />
<asp:CheckBoxField DataField="featured"
HeaderText="featured" SortExpression="featured" />
<asp:BoundField DataField="popularity"
HeaderText="popularity" SortExpression="popularity" />
<asp:BoundField DataField="taxRate"
HeaderText="taxRate" SortExpression="taxRate" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
and the full text of the stack trace:
[InvalidOperationException: The type specified in the TypeName property
of ObjectDataSource 'ObjectDataSource1' could not be found.]
System.Web.UI.WebControls.ObjectDataSourceView.GetType(String
typeName) +1261639
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments
arguments) +1936
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments
arguments, DataSourceViewSelectCallback callback) +17
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
+69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +41
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42;
ASP.NET Version:2.0.50727.210