Hi Tdar,
I've just tried the dataset xml and db script you provided, seems the table
structure is very large which contains lots of columns, I can't quite get
how to fill some test data. If convenient would you also attache some test
data to me?
Also ,based on the ASP.NET page's aspx template you provided, I found that
you set the ObjectDataSource's DataObjectTypeName to "System.Guid", this
is incorrect since ObjectDataSource.DataObjectTypeName should be configured
to a type which contains the Properties that can mapped to all the
parameters in your update, insert methods....
You can view the description in the MSDN document:
#ObjectDataSource.DataObjectTypeName Property
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.objectdat
asource.dataobjecttypename.aspx
So for your scenario I think the DataObjectTypeName should be configured to
"DJP_DataSet1.OrderShipRecordRow" ...
You can have a look , if anything unclear, please feel free to post here.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: detailsview,
| thread-index: AcYatwcMewVhKBVrRJq376XEWAmeyA==
| X-WBNR-Posting-Host: 24.73.223.27
| From: "=?Utf-8?B?VGRhclRkYXI=?=" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: RE: detailsview,
| Date: Mon, 16 Jan 2006 08:08:02 -0800
| Lines: 598
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:32507
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi, as I said i used the wizards, and yes
| > when try performing
| > update operation, there raise some exception indicate that the certain
| > class lack of certain properties... yes?
|
| DJP_Dataset1:
| ====================
| <?xml version="1.0" encoding="utf-8"?>
| <xs:schema id="DJP_DataSet1"
| targetNamespace="
http://tempuri.org/DJP_DataSet1.xsd"
| xmlns:mstns="
http://tempuri.org/DJP_DataSet1.xsd"
| xmlns="
http://tempuri.org/DJP_DataSet1.xsd"
| xmlns:xs="
http://www.w3.org/2001/XMLSchema"
| xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
| xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"
| attributeFormDefault="qualified" elementFormDefault="qualified">
| <xs:annotation>
| <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
| <DataSource DefaultConnectionIndex="0"
| FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout,
AnsiClass,
| Class, Public" SchemaSerializationMode="IncludeSchema"
| xmlns="urn:schemas-microsoft-com:xml-msdatasource">
| <Connections>
| <Connection AppSettingsObjectName="Web.config"
| AppSettingsPropertyName="SilverQueen_Main_SystemConnectionString1"
| ConnectionStringObject="" IsAppSettingsProperty="True"
Modifier="Assembly"
| Name="SilverQueen_Main_SystemConnectionString1 (Web.config)"
| ParameterPrefix="@"
|
PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.Con
nectionStrings.SilverQueen_Main_SystemConnectionString1.ConnectionString"
| Provider="System.Data.SqlClient">
| </Connection>
| </Connections>
| <Tables>
| <TableAdapter BaseClass="System.ComponentModel.Component"
| DataAccessorModifier="AutoLayout, AnsiClass, Class, Public"
| DataAccessorName="OrderShipRecordTableAdapter"
| GeneratorDataComponentClassName="OrderShipRecordTableAdapter"
| Name="OrderShipRecord"
UserDataComponentName="OrderShipRecordTableAdapter">
| <MainSource>
| <DbSource
| ConnectionRef="SilverQueen_Main_SystemConnectionString1 (Web.config)"
| DbObjectName="SilverQueen_Main_System.db
rderShipRecord"
| DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill"
| GenerateMethods="Both" GenerateShortCommands="True"
| GeneratorGetMethodName="GetData" GeneratorSourceName="Fill"
| GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset"
| ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0,
Culture=neutral,
| PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False"
| UserGetMethodName="GetData" UserSourceName="Fill">
| <DeleteCommand>
| <DbCommand CommandType="Text" ModifiedByUser="False">
| <CommandText>DELETE FROM [OrderShipRecord] WHERE
| (([ShipKey] = @Original_ShipKey))</CommandText>
| <Parameters>
| <Parameter AllowDbNull="False" AutogeneratedName=""
| DataSourceName="" DbType="Guid" Direction="Input"
| ParameterName="@Original_ShipKey" Precision="0"
| ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="ShipKey"
| SourceColumnNullMapping="False" SourceVersion="Original">
| </Parameter>
| </Parameters>
| </DbCommand>
| </DeleteCommand>
| <SelectCommand>
| <DbCommand CommandType="Text" ModifiedByUser="True">
| <CommandText>SELECT DBMANTransNumber, UserId,
| ShiptoCompany, ShiptoName, ShipToAddress, ShipToAddress2, ShipCity,
| ShipCountry, ShipState, ZipCode,
| SignatureReq, ShipKey
| FROM OrderShipRecord
| WHERE (ShipKey = @ShipKey)</CommandText>
| <Parameters>
| <Parameter AllowDbNull="False"
| AutogeneratedName="ShipKey" ColumnName="ShipKey"
| DataSourceName="SilverQueen_Main_System.db
rderShipRecord"
| DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input"
| ParameterName="@ShipKey" Precision="0" ProviderType="UniqueIdentifier"
| Scale="0" Size="16" SourceColumn="ShipKey"
SourceColumnNullMapping="False"
| SourceVersion="Current">
| </Parameter>
| </Parameters>
| </DbCommand>
| </SelectCommand>
| <UpdateCommand>
| <DbCommand CommandType="Text" ModifiedByUser="False">
| <CommandText>UPDATE [OrderShipRecord] SET
| [DBMANTransNumber] = @DBMANTransNumber, [UserId] = @UserId,
[ShiptoCompany] =
| @ShiptoCompany, [ShiptoName] = @ShiptoName, [ShipToAddress] =
@ShipToAddress,
| [ShipToAddress2] = @ShipToAddress2, [ShipCity] = @ShipCity, [ShipCountry]
=
| @ShipCountry, [ShipState] = @ShipState, [ZipCode] = @ZipCode,
[SignatureReq]
| = @SignatureReq, [ShipKey] = @ShipKey WHERE (([ShipKey] =
| @Original_ShipKey))</CommandText>
| <Parameters>
| <Parameter AllowDbNull="False" AutogeneratedName=""
| DataSourceName="" DbType="String" Direction="Input"
| ParameterName="@DBMANTransNumber" Precision="0" ProviderType="NVarChar"
| Scale="0" Size="0" SourceColumn="DBMANTransNumber"
| SourceColumnNullMapping="False" SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="False" AutogeneratedName=""
| DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@UserId"
| Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0"
| SourceColumn="UserId" SourceColumnNullMapping="False"
SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="String" Direction="Input"
| ParameterName="@ShiptoCompany" Precision="0" ProviderType="NVarChar"
| Scale="0" Size="0" SourceColumn="ShiptoCompany"
| SourceColumnNullMapping="False" SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="String" Direction="Input"
| ParameterName="@ShiptoName" Precision="0" ProviderType="NVarChar"
Scale="0"
| Size="0" SourceColumn="ShiptoName" SourceColumnNullMapping="False"
| SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="String" Direction="Input"
| ParameterName="@ShipToAddress" Precision="0" ProviderType="NVarChar"
| Scale="0" Size="0" SourceColumn="ShipToAddress"
| SourceColumnNullMapping="False" SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="String" Direction="Input"
| ParameterName="@ShipToAddress2" Precision="0" ProviderType="NVarChar"
| Scale="0" Size="0" SourceColumn="ShipToAddress2"
| SourceColumnNullMapping="False" SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="Int32" Direction="Input"
ParameterName="@ShipCity"
| Precision="0" ProviderType="Int" Scale="0" Size="0"
SourceColumn="ShipCity"
| SourceColumnNullMapping="False" SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="Int32" Direction="Input"
| ParameterName="@ShipCountry" Precision="0" ProviderType="Int" Scale="0"
| Size="0" SourceColumn="ShipCountry" SourceColumnNullMapping="False"
| SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="Int32" Direction="Input"
ParameterName="@ShipState"
| Precision="0" ProviderType="Int" Scale="0" Size="0"
SourceColumn="ShipState"
| SourceColumnNullMapping="False" SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="String" Direction="Input"
ParameterName="@ZipCode"
| Precision="0" ProviderType="NVarChar" Scale="0" Size="0"
| SourceColumn="ZipCode" SourceColumnNullMapping="False"
| SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="True" AutogeneratedName=""
| DataSourceName="" DbType="Boolean" Direction="Input"
| ParameterName="@SignatureReq" Precision="0" ProviderType="Bit" Scale="0"
| Size="0" SourceColumn="SignatureReq" SourceColumnNullMapping="False"
| SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="False" AutogeneratedName=""
| DataSourceName="" DbType="Guid" Direction="Input"
ParameterName="@ShipKey"
| Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0"
| SourceColumn="ShipKey" SourceColumnNullMapping="False"
| SourceVersion="Current">
| </Parameter>
| <Parameter AllowDbNull="False" AutogeneratedName=""
| DataSourceName="" DbType="Guid" Direction="Input"
| ParameterName="@Original_ShipKey" Precision="0"
| ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="ShipKey"
| SourceColumnNullMapping="False" SourceVersion="Original">
| </Parameter>
| </Parameters>
| </DbCommand>
| </UpdateCommand>
| </DbSource>
| </MainSource>
| <Mappings>
| <Mapping SourceColumn="DBMANTransNumber"
| DataSetColumn="DBMANTransNumber" />
| <Mapping SourceColumn="UserId" DataSetColumn="UserId" />
| <Mapping SourceColumn="ShiptoCompany"
| DataSetColumn="ShiptoCompany" />
| <Mapping SourceColumn="ShiptoName"
DataSetColumn="ShiptoName" />
| <Mapping SourceColumn="ShipToAddress"
| DataSetColumn="ShipToAddress" />
| <Mapping SourceColumn="ShipToAddress2"
| DataSetColumn="ShipToAddress2" />
| <Mapping SourceColumn="ShipCity" DataSetColumn="ShipCity" />
| <Mapping SourceColumn="ShipCountry"
| DataSetColumn="ShipCountry" />
| <Mapping SourceColumn="ShipState" DataSetColumn="ShipState"
/>
| <Mapping SourceColumn="ZipCode" DataSetColumn="ZipCode" />
| <Mapping SourceColumn="SignatureReq"
| DataSetColumn="SignatureReq" />
| <Mapping SourceColumn="ShipKey" DataSetColumn="ShipKey" />
| </Mappings>
| <Sources>
| </Sources>
| </TableAdapter>
| </Tables>
| <Sources>
| </Sources>
| </DataSource>
| </xs:appinfo>
| </xs:annotation>
| <xs:element name="DJP_DataSet1" msdata:IsDataSet="true"
| msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="DJP_DataSet1"
| msprop:Generator_DataSetName="DJP_DataSet1">
| <xs:complexType>
| <xs:choice minOccurs="0" maxOccurs="unbounded">
| <xs:element name="OrderShipRecord"
| msprop:Generator_UserTableName="OrderShipRecord"
| msprop:Generator_RowDeletedName="OrderShipRecordRowDeleted"
| msprop:Generator_RowChangedName="OrderShipRecordRowChanged"
| msprop:Generator_RowClassName="OrderShipRecordRow"
| msprop:Generator_RowChangingName="OrderShipRecordRowChanging"
| msprop:Generator_RowEvArgName="OrderShipRecordRowChangeEvent"
| msprop:Generator_RowEvHandlerName="OrderShipRecordRowChangeEventHandler"
| msprop:Generator_TableClassName="OrderShipRecordDataTable"
| msprop:Generator_TableVarName="tableOrderShipRecord"
| msprop:Generator_RowDeletingName="OrderShipRecordRowDeleting"
| msprop:Generator_TablePropName="OrderShipRecord">
| <xs:complexType>
| <xs:sequence>
| <xs:element name="DBMANTransNumber"
| msprop:Generator_UserColumnName="DBMANTransNumber"
| msprop:Generator_ColumnVarNameInTable="columnDBMANTransNumber"
| msprop:Generator_ColumnPropNameInRow="DBMANTransNumber"
| msprop:Generator_ColumnPropNameInTable="DBMANTransNumberColumn">
| <xs:simpleType>
| <xs:restriction base="xs:string">
| <xs:maxLength value="10" />
| </xs:restriction>
| </xs:simpleType>
| </xs:element>
| <xs:element name="UserId" msdata
ataType="System.Guid,
| mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
| msprop:Generator_UserColumnName="UserId"
| msprop:Generator_ColumnVarNameInTable="columnUserId"
| msprop:Generator_ColumnPropNameInRow="UserId"
| msprop:Generator_ColumnPropNameInTable="UserIdColumn" type="xs:string" />
| <xs:element name="ShiptoCompany"
| msprop:Generator_UserColumnName="ShiptoCompany"
| msprop:Generator_ColumnVarNameInTable="columnShiptoCompany"
| msprop:Generator_ColumnPropNameInRow="ShiptoCompany"
| msprop:Generator_ColumnPropNameInTable="ShiptoCompanyColumn"
minOccurs="0">
| <xs:simpleType>
| <xs:restriction base="xs:string">
| <xs:maxLength value="80" />
| </xs:restriction>
| </xs:simpleType>
| </xs:element>
| <xs:element name="ShiptoName"
| msprop:Generator_UserColumnName="ShiptoName"
| msprop:Generator_ColumnVarNameInTable="columnShiptoName"
| msprop:Generator_ColumnPropNameInRow="ShiptoName"
| msprop:Generator_ColumnPropNameInTable="ShiptoNameColumn" minOccurs="0">
| <xs:simpleType>
| <xs:restriction base="xs:string">
| <xs:maxLength value="80" />
| </xs:restriction>
| </xs:simpleType>
| </xs:element>
| <xs:element name="ShipToAddress"
| msprop:Generator_UserColumnName="ShipToAddress"
| msprop:Generator_ColumnVarNameInTable="columnShipToAddress"
| msprop:Generator_ColumnPropNameInRow="ShipToAddress"
| msprop:Generator_ColumnPropNameInTable="ShipToAddressColumn"
minOccurs="0">
| <xs:simpleType>
| <xs:restriction base="xs:string">
| <xs:maxLength value="80" />
| </xs:restriction>
| </xs:simpleType>
| </xs:element>
| <xs:element name="ShipToAddress2"
| msprop:Generator_UserColumnName="ShipToAddress2"
| msprop:Generator_ColumnVarNameInTable="columnShipToAddress2"
| msprop:Generator_ColumnPropNameInRow="ShipToAddress2"
| msprop:Generator_ColumnPropNameInTable="ShipToAddress2Column"
minOccurs="0">
| <xs:simpleType>
| <xs:restriction base="xs:string">
| <xs:maxLength value="80" />
| </xs:restriction>
| </xs:simpleType>
| </xs:element>
| <xs:element name="ShipCity"
| msprop:Generator_UserColumnName="ShipCity"
| msprop:Generator_ColumnVarNameInTable="columnShipCity"
| msprop:Generator_ColumnPropNameInRow="ShipCity"
| msprop:Generator_ColumnPropNameInTable="ShipCityColumn" type="xs:int"
| minOccurs="0" />
| <xs:element name="ShipCountry"
| msprop:Generator_UserColumnName="ShipCountry"
| msprop:Generator_ColumnVarNameInTable="columnShipCountry"
| msprop:Generator_ColumnPropNameInRow="ShipCountry"
| msprop:Generator_ColumnPropNameInTable="ShipCountryColumn" type="xs:int"
| minOccurs="0" />
| <xs:element name="ShipState"
| msprop:Generator_UserColumnName="ShipState"
| msprop:Generator_ColumnVarNameInTable="columnShipState"
| msprop:Generator_ColumnPropNameInRow="ShipState"
| msprop:Generator_ColumnPropNameInTable="ShipStateColumn" type="xs:int"
| minOccurs="0" />
| <xs:element name="ZipCode"
| msprop:Generator_UserColumnName="ZipCode"
| msprop:Generator_ColumnVarNameInTable="columnZipCode"
| msprop:Generator_ColumnPropNameInRow="ZipCode"
| msprop:Generator_ColumnPropNameInTable="ZipCodeColumn" minOccurs="0">
| <xs:simpleType>
| <xs:restriction base="xs:string">
| <xs:maxLength value="10" />
| </xs:restriction>
| </xs:simpleType>
| </xs:element>
| <xs:element name="SignatureReq"
| msprop:Generator_UserColumnName="SignatureReq"
| msprop:Generator_ColumnVarNameInTable="columnSignatureReq"
| msprop:Generator_ColumnPropNameInRow="SignatureReq"
| msprop:Generator_ColumnPropNameInTable="SignatureReqColumn"
type="xs:boolean"
| minOccurs="0" />
| <xs:element name="ShipKey" msdata
ataType="System.Guid,
| mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
| msprop:Generator_UserColumnName="ShipKey"
| msprop:Generator_ColumnVarNameInTable="columnShipKey"
| msprop:Generator_ColumnPropNameInRow="ShipKey"
| msprop:Generator_ColumnPropNameInTable="ShipKeyColumn" type="xs:string" />
| </xs:sequence>
| </xs:complexType>
| </xs:element>
| </xs:choice>
| </xs:complexType>
| <xs:unique name="Constraint1" msdata
rimaryKey="true">
| <xs:selector xpath=".//mstns:OrderShipRecord" />
| <xs:field xpath="mstns:ShipKey" />
| </xs:unique>
| </xs:element>
| </xs:schema>
| ====================================
| This previous dataset that was created by the wizards brings up 53
warnings
| and 43 messages, but no errors, FYI..
|
| Page code:
|
| showshipdetails.aspx:
| ==================================
|
| <asp
etailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
| DataKeyNames="ShipKey" DataSourceID="ObjectDataSource1"
| Height="50px" Width="125px">
| <Fields>
| <asp:BoundField DataField="DBMANTransNumber"
| HeaderText="DBMANTransNumber" SortExpression="DBMANTransNumber" />
| <asp:BoundField DataField="UserId" HeaderText="UserId"
| SortExpression="UserId" />
| <asp:BoundField DataField="ShiptoCompany"
| HeaderText="ShiptoCompany" SortExpression="ShiptoCompany" />
| <asp:BoundField DataField="ShiptoName"
HeaderText="ShiptoName"
| SortExpression="ShiptoName" />
| <asp:BoundField DataField="ShipToAddress"
| HeaderText="ShipToAddress" SortExpression="ShipToAddress" />
| <asp:BoundField DataField="ShipToAddress2"
| HeaderText="ShipToAddress2" SortExpression="ShipToAddress2" />
| <asp:BoundField DataField="ShipCity" HeaderText="ShipCity"
| SortExpression="ShipCity" />
| <asp:BoundField DataField="ShipCountry"
HeaderText="ShipCountry"
| SortExpression="ShipCountry" />
| <asp:BoundField DataField="ShipState" HeaderText="ShipState"
| SortExpression="ShipState" />
| <asp:BoundField DataField="ZipCode" HeaderText="ZipCode"
| SortExpression="ZipCode" />
| <asp:CheckBoxField DataField="SignatureReq"
| HeaderText="SignatureReq" SortExpression="SignatureReq" />
| <asp:BoundField DataField="ShipKey" HeaderText="ShipKey"
| ReadOnly="True" SortExpression="ShipKey" />
| <asp:CommandField ShowEditButton="True" />
| </Fields>
| </asp
etailsView>
| <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
| DataObjectTypeName="System.Guid"
| DeleteMethod="Delete"
OldValuesParameterFormatString="original_{0}"
| SelectMethod="GetData"
| TypeName="DJP_DataSet1TableAdapters.OrderShipRecordTableAdapter"
| UpdateMethod="Update">
| <UpdateParameters>
| <asp
arameter Name="DBMANTransNumber" Type="String" />
| <asp
arameter Name="UserId" Type="Object" />
| <asp
arameter Name="ShiptoCompany" Type="String" />
| <asp
arameter Name="ShiptoName" Type="String" />
| <asp
arameter Name="ShipToAddress" Type="String" />
| <asp
arameter Name="ShipToAddress2" Type="String" />
| <asp
arameter Name="ShipCity" Type="Int32" />
| <asp
arameter Name="ShipCountry" Type="Int32" />
| <asp
arameter Name="ShipState" Type="Int32" />
| <asp
arameter Name="ZipCode" Type="String" />
| <asp
arameter Name="SignatureReq" Type="Boolean" />
| <asp
arameter Name="ShipKey" Type="Object" />
| <asp
arameter Name="Original_ShipKey" Type="Object" />
| </UpdateParameters>
| <SelectParameters>
| <asp:QueryStringParameter Name="ShipKey"
| QueryStringField="ShipKey" Type="Object" />
| </SelectParameters>
| </asp:ObjectDataSource>
|
|
| ==============================================
|
|
|
|
|
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Tdar,
| >
| > Welcome to ASPNET newsgroup.
| > From your description, you're using a certain
TypedDataset(TableAdapter?)
| > to return some Data records through datatable and some certain methods
for
| > update and delete. And you configure the Data Access component through
| > ObjectDataSource , it can display data well, however, when try
performing
| > update operation, there raise some exception indicate that the certain
| > class lack of certain properties... yes?
| >
| > Based on my experience, this is likely caused by the the DataAccess
| > component class's Update method's parameters list dosn't match the
| > DataBound control's supplied parameters.... As the error message
| > indicated:
| > =====================
| > Could not find a property named 'DBMANTransNumber' on the type
specified by
| > the DataObjectTypeName property in ObjectDataSource
'ObjectDataSource1'.
| > =====================
| >
| > So you can check the update parameters in the DataBound control (or you
can
| > use the Updating event to printout all the supplief update
parameters...).
| > Those parameters will be used by the ObjectDataSource control so as to
mapp
| > them to each of the parameters in the Update method or properties of
the
| > Data Object configured in ObjectDataSource (as parameter in the Update
| > method...)..
| >
| > In addition, if convenient, would you post some further detailed code
| > snippet and aspx template on the ObjectDataSource, DataBound control
and
| > the typed dataset so that we can have a look on them?
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: detailsview,
| > | thread-index: AcYYg8SbbQRjhNvTTkSewzRImpqrOA==
| > | X-WBNR-Posting-Host: 24.73.223.27
| > | From: "=?Utf-8?B?VGRhclRkYXI=?=" <
[email protected]>
| > | Subject: detailsview,
| > | Date: Fri, 13 Jan 2006 12:56:04 -0800
| > | Lines: 98
| > | Message-ID: <
[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:32460
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | Why would i get this error:
| > | Could not find a property named 'DBMANTransNumber' on the type
specified
| > by
| > | the DataObjectTypeName property in ObjectDataSource
'ObjectDataSource1'.
| > |
| > | Here what I am doing, I am using a dataset completly setup by the
wizards
| > | under the app_code directory, I do a simple "Select * from
| > ordershiprecord
| > | where ShipKey = @ShipKey" click next, leave fill a datatable, return
a
| > | datatable, create methods to send updates directly to the
| > | database(generateDBDirectMethods) all checked, THen click next again,
it
| > says
| > | it generated select, update, delete, table mappings, fil method,
update
| > | methods...
| > |
| > | Then i go to a new web form and drag in a detailsview, choose new
| > datasource,
| > | object, select the
"DJP_DataSet1TableAdpters.OrderShipRecordTableAdapter"
| > | that is in the drop down. Click next, look around to see that the
| > |
| > | select(GetData(Guid ShipKey), returns OrderShipRecordDataTable)
| > |
| > | update(Update(String DBMANTransNumber, Guid UserId, String
ShiptoCompany,
| > | String ShiptoName, String ShipToAddress, String ShipToAddress2,
| > | Nullable<Int32> ShipCity, Nullable<Int32> ShipCountry,
Nullable<Int32>
| > | ShipState, String ZipCode, Nullable<Boolean> SignatureReq, Guid
ShipKey,
| > Guid
| > | Original_ShipKey), returns Int32)
| > |
| > | delete(Delete(Guid Original_ShipKey), returns Int32) method is there
| > |
| > | Click next
| > | it asks to defind Parameters ... QueryString ... Querystringfield =
| > ShipKey
| > | Click Finish...
| > |
| > | Page is created
| > | Select enable editing and save the page
| > |
| > | Run the calling page from visual studio...
| > | type in shipkey and call the page
| > | it shows me the records details just fine
| > | so i click Edit to change a value
| > | changed Signaturereq and selected Update.
| > |
| > | I get:
| > | ---------------------------------------
| > | Could not find a property named 'DBMANTransNumber' on the type
specified
| > by
| > | the DataObjectTypeName property in ObjectDataSource
'ObjectDataSource1'.
| > | Description: An unhandled exception occurred during the execution of
the
| > | current web request. Please review the stack trace for more
information
| > about
| > | the error and where it originated in the code.
| > |
| > | Exception Details: System.InvalidOperationException: Could not find a
| > | property named 'DBMANTransNumber' on the type specified by the
| > | DataObjectTypeName property in ObjectDataSource 'ObjectDataSource1'.
| > |
| > | Source Error:
| > |
| > | An unhandled exception was generated during the execution of the
current
| > web
| > | request. Information regarding the origin and location of the
exception
| > can
| > | be identified using the exception stack trace below.
| > |
| > | Stack Trace:
| > |
| > |
| > | [InvalidOperationException: Could not find a property named
| > | 'DBMANTransNumber' on the type specified by the DataObjectTypeName
| > property
| > | in ObjectDataSource 'ObjectDataSource1'.]
| > |
System.Web.UI.WebControls.ObjectDataSourceView.BuildDataObject(Type
| > | dataObjectType, IDictionary inputParameters) +380
| > |
| >
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary
| > | keys, IDictionary values, IDictionary oldValues) +1512
| > | System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary
| > values,
| > | IDictionary oldValues, DataSourceViewOperationCallback callback) +179
| > | System.Web.UI.WebControls.DetailsView.HandleUpdate(String
commandArg,
| > | Boolean causesValidation) +1197
| > | System.Web.UI.WebControls.DetailsView.HandleEvent(EventArgs e,
Boolean
| > | causesValidation, String validationGroup) +545
| > | System.Web.UI.WebControls.DetailsView.OnBubbleEvent(Object source,
| > | EventArgs e) +162
| > | System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args)
| > +56
| > | System.Web.UI.WebControls.DetailsViewRow.OnBubbleEvent(Object
source,
| > | EventArgs e) +117
| > | System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args)
| > +56
| > | System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
+106
| > | System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
| > | eventArgument) +175
| > |
| > |
| >
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.Rai
| > sePostBackEvent(String eventArgument) +31
| > | System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
| > | sourceControl, String eventArgument) +32
| > | System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData)
| > +244
| > | System.Web.UI.
| > | -------------------------------------------
| > |
| > |
| > | So why when using the wizards would this happen, how do i solve this
and
| > | move on....
| > |
| > | Tdar
| > |
| > |
| > |
| > |
| >
| >
|