Wrox Programmer Forums
|
Visual Studio 2005 For discussing Visual Studio 2005. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 16th, 2006, 06:05 PM
Registered User
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET

I am having a challenge with the following error: ObjectDataSource 'odsDiv' could not find a non-generic method 'Update' that has parameters:divID, divName, original_divID

I only have 2 fields in this table, divID, divName. I can insert and delete records, but the Update fails.

I saw another post for this dated: 04/07/2006 : 1:00:17, fortunately the poster was able to get past the issue but did not indicate how.

As mentioned in the earlier post's replies, I edited the OldValuesParamaterFormatString and removed the original_.

Following are the error details.

Exception Details: System.InvalidOperationException: ObjectDataSource 'odsDiv' could not find a non-generic method 'Update' that has parameters: divID, divName, original_divID.

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: ObjectDataSource 'odsDiv' could not find a non-generic method 'Update' that has parameters: divID, divName, original_divID.]
System.Web.UI.WebControls.ObjectDataSourceVi ew.GetResolvedMethodData(Type type, String methodName, IDictionary allParameters, DataSourceOperation operation) +1134
System.Web.UI.WebControls.ObjectDataSourceVi ew.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +2241
System.Web.UI.DataSourceView.Update(IDiction ary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
System.Web.UI.WebControls.DetailsView.Handle Update(String commandArg, Boolean causesValidation) +1152
System.Web.UI.WebControls.DetailsView.Handle Event(EventArgs e, Boolean causesValidation, String validationGroup) +450
System.Web.UI.WebControls.DetailsView.OnBubb leEvent(Object source, EventArgs e) +87
System.Web.UI.Control.RaiseBubbleEvent(Objec t source, EventArgs args) +35
System.Web.UI.WebControls.DetailsViewRow.OnB ubbleEvent(Object source, EventArgs e) +109
System.Web.UI.Control.RaiseBubbleEvent(Objec t source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnComma nd(CommandEventArgs e) +85
System.Web.UI.WebControls.LinkButton.RaisePo stBackEvent(String eventArgument) +153
System.Web.UI.WebControls.LinkButton.System. Web.UI.IPostBackEventHandler.RaisePostBackEvent(St ring eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostB ackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameVa lueCollection postData) +170
System.Web.UI.Page.ProcessRequestMain(Boolea n includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921

Everytime I have tried to do ASP I have run into this challenge & moved to a different platform. I would like to figure this out once and for all, your help is greatly appreciated.

Uncle Buck
 
Old November 18th, 2006, 09:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post the code for your ASPX page and for the business object that you're trying to call??

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old November 22nd, 2006, 01:55 PM
Registered User
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using Vis Studio 2005 Express so I think things may be a little different in what is available... I hope you, or someone, can still help.

following is the content of the asp:content object:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="divID"
        DataSourceID="odsDiv" Height="50px" Width="125px">
        <Fields>
            <asp:BoundField DataField="divID" HeaderText="divID" ReadOnly="True" SortExpression="divID" />
            <asp:BoundField DataField="divName" HeaderText="divName" SortExpression="divName" />
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" />
        </Fields>
    </asp:DetailsView>
    <asp:ObjectDataSource ID="odsDiv" runat="server" DeleteMethod="Delete" InsertMethod="Insert"
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetDivByID" TypeName="dsDivisionTableAdapters.daDivByIDTableAd apter"
        UpdateMethod="Update">
        <DeleteParameters>
            <asp:Parameter Name="Original_divID" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="divID" Type="String" />
            <asp:Parameter Name="divName" Type="String" />
            <asp:Parameter Name="Original_divID" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="SB" Name="ID" QueryStringField="ID" Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="divID" Type="String" />
            <asp:Parameter Name="divName" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>

As far as the code to the Business Object (odsDiv) I am not sure if that is exposed in Express?

The Update Command, created when configuring the datasource is: Update(String divID, String divName, String Original_divID), returns Int32

Uncle BUck
 
Old November 25th, 2006, 07:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

As long as you have the code in the App_Code folder or in a separate assembly (DLL), the code should be visible by the ASPX page. The fact you're using Express doesn't make a difference.

But where is dsDivisionTableAdapters.daDivByIDTableAdapter defined? How does the Update method look like? Is it a custom class you created yourself?

Also, make sure the spelling of parameter names matches the parameters in the ObjectDataSource.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old November 27th, 2006, 05:37 PM
Registered User
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx Imar, I found the info. A couple object names are different because I have retried a couple time to make this work but following is the schema for the business object:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="dsDivision" targetNamespace="http://tempuri.org/dsDivision.xsd" xmlns:mstns="http://tempuri.org/dsDivision.xsd" xmlns="http://tempuri.org/dsDivision.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="SafetyConnectionString1" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="SafetyConnectionString1 (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration. ConfigurationManager.0.ConnectionStrings.SafetyCon nectionString1.ConnectionString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="daDivisionTableAdapter" GeneratorDataComponentClassName="daDivisionTableAd apter" Name="daDivision" UserDataComponentName="daDivisionTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SafetyConnectionString1 (Web.config)" DbObjectName="dbo.tblDivision" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillDivKist" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetDivList" GeneratorSourceName="FillDivKist" GetMethodModifier="Public" GetMethodName="GetDivList" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetDivList" UserSourceName="FillDivKist">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>DELETE FROM [tblDivision] WHERE (([divID] = @Original_ID))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@Original_ID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>INSERT INTO [tblDivision] ([divID], [divName]) VALUES (@ID, @Division)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Division" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Division" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT divID AS ID, divName AS Division
FROM tblDivision</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>UPDATE [tblDivision] SET [divID] = @ID, [divName] = @Division WHERE (([divID] = @Original_ID))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Division" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Division" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@Original_ID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="ID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="ID" DataSetColumn="ID" />
              <Mapping SourceColumn="Division" DataSetColumn="Division" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SafetyConnectionString1 (Web.config)" DbObjectName="dbo.tblDivision" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByDivID" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetByDivID" GeneratorSourceName="FillByDivID" GetMethodModifier="Public" GetMethodName="GetByDivID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetByDivID" UserSourceName="FillByDivID">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT divID AS ID, divName AS Division
FROM tblDivision
WHERE (divID = @ID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="ID" ColumnName="divID" DataSourceName="[C:\DOCUMENTS AND SETTINGS\LBUCHWALD\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\SAFETY\APP_DATA\SAFETY.MDF].dbo.tblDivision" DataTypeServer="nchar(2)" DbType="String" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="NChar" Scale="0" Size="2" SourceColumn="ID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="daDivByIDTableAdapter" GeneratorDataComponentClassName="daDivByIDTableAda pter" Name="daDivByID" UserDataComponentName="daDivByIDTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SafetyConnectionString1 (Web.config)" DbObjectName="dbo.tblDivision" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="FillByID" GenerateMethods="Both" GenerateShortCommands="True" GeneratorGetMethodName="GetDivByID" GeneratorSourceName="FillByID" GetMethodModifier="Public" GetMethodName="GetDivByID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetDivByID" UserSourceName="FillByID">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>DELETE FROM [tblDivision] WHERE (([divID] = @Original_divID))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@Original_divID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="divID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>INSERT INTO [tblDivision] ([divID], [divName]) VALUES (@divID, @divName);
SELECT divID, divName FROM tblDivision WHERE (divID = @divID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@divID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="divID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@divName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="divName" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT divID, divName
FROM tblDivision
WHERE (divID = @ID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="ID" ColumnName="divID" DataSourceName="[C:\DOCUMENTS AND SETTINGS\LBUCHWALD\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\SAFETY\APP_DATA\SAFETY.MDF].dbo.tblDivision" DataTypeServer="nchar(2)" DbType="String" Direction="Input" ParameterName="@ID" Precision="0" ProviderType="NChar" Scale="0" Size="2" SourceColumn="divID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>UPDATE [tblDivision] SET [divID] = @divID, [divName] = @divName WHERE (([divID] = @Original_divID));
SELECT divID, divName FROM tblDivision WHERE (divID = @divID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@divID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="divID" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@divName" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="divName" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="StringFixedLength" Direction="Input" ParameterName="@Original_divID" Precision="0" ProviderType="NChar" Scale="0" Size="0" SourceColumn="divID" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="divID" DataSetColumn="divID" />
              <Mapping SourceColumn="divName" DataSetColumn="divName" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="dsDivision" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dsDivision" msprop:Generator_DataSetName="dsDivision">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="daDivision" msprop:Generator_UserTableName="daDivision" msprop:Generator_RowDeletedName="daDivisionRowDele ted" msprop:Generator_RowChangedName="daDivisionRowChan ged" msprop:Generator_RowClassName="daDivisionRow" msprop:Generator_RowChangingName="daDivisionRowCha nging" msprop:Generator_RowEvArgName="daDivisionRowChange Event" msprop:Generator_RowEvHandlerName="daDivisionRowCh angeEventHandler" msprop:Generator_TableClassName="daDivisionDataTab le" msprop:Generator_TableVarName="tabledaDivision" msprop:Generator_RowDeletingName="daDivisionRowDel eting" msprop:Generator_TablePropName="daDivision">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ID" msprop:Generator_UserColumnName="ID" msprop:Generator_ColumnVarNameInTable="columnID" msprop:Generator_ColumnPropNameInRow="ID" msprop:Generator_ColumnPropNameInTable="IDColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Division" msprop:Generator_UserColumnName="Division" msprop:Generator_ColumnVarNameInTable="columnDivis ion" msprop:Generator_ColumnPropNameInRow="Division" msprop:Generator_ColumnPropNameInTable="DivisionCo lumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="daDivByID" msprop:Generator_UserTableName="daDivByID" msprop:Generator_RowDeletedName="daDivByIDRowDelet ed" msprop:Generator_RowChangedName="daDivByIDRowChang ed" msprop:Generator_RowClassName="daDivByIDRow" msprop:Generator_RowChangingName="daDivByIDRowChan ging" msprop:Generator_RowEvArgName="daDivByIDRowChangeE vent" msprop:Generator_RowEvHandlerName="daDivByIDRowCha ngeEventHandler" msprop:Generator_TableClassName="daDivByIDDataTabl e" msprop:Generator_TableVarName="tabledaDivByID" msprop:Generator_RowDeletingName="daDivByIDRowDele ting" msprop:Generator_TablePropName="daDivByID">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="divID" msprop:Generator_UserColumnName="divID" msprop:Generator_ColumnPropNameInRow="divID" msprop:Generator_ColumnVarNameInTable="columndivID " msprop:Generator_ColumnPropNameInTable="divIDColum n">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="divName" msprop:Generator_UserColumnName="divName" msprop:Generator_ColumnPropNameInRow="divName" msprop:Generator_ColumnVarNameInTable="columndivNa me" msprop:Generator_ColumnPropNameInTable="divNameCol umn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:daDivision" />
      <xs:field xpath="mstns:ID" />
    </xs:unique>
    <xs:unique name="daDivByID_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:daDivByID" />
      <xs:field xpath="mstns:divID" />
    </xs:unique>
  </xs:element>
</xs:schema>

Under the UPDATECOMMAND it shows:
UPDATE [tblDivision] SET [divID] = @divID, [divName] = @divName WHERE (([divID] = @Original_divID));

Would it work better as:
UPDATE [tblDivision] SET [divName] = @divName WHERE (([divID] = @Original_divID));
?
The DivName field is the only field I actually want updated, the divID is the primary key.

Uncle Buck
 
Old November 27th, 2006, 06:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It looks like your object expects the following params:

ID
Division
Original_ID

Have you tried these, instead of divID, divName and original_divID?

Try modifying the UpdateParameters element of the ObjectDataSource so their names matches those from the business object.

Hope this helps,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old November 28th, 2006, 11:17 AM
Registered User
 
Join Date: Nov 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar, I really appreciate your help.

As I indicated, I have tried this a couple times. Originally I used the field names & had the problem, then I tried the ID & Division aliases, wanting to have the Field captions show something less cryptic than divID and divName. When I tried that the error showed: ObjectDataSource 'odsDiv' could not find a non-generic method 'Update' that has parameters:ID, Division, original_ID. Same error, it just used the alias names instead.

Each time that I have tried a different way, I have deleted the aspx page & started fresh to work with a clean page.

To build the form, I completely used the wizards and visual tools. I even followed some video tutorials, exchanging my tables for those in the videos & used the same techniques as the video. If there was something wrong with the way the tools wrote the objects and code, everyone using them should have this issue.

I can insert new records, and delete records. But update fails every time.

Uncle Buck
 
Old November 28th, 2006, 06:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In that case, I am out of ideas. It's hard to see what's going on without seeing your entire project and code, and if following tutorials doesn't work, I don't know what to add.

Sorry....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 3.5 answers in Professional ASP.NET 3.5 jminatel ASP.NET 3.5 Professionals 1 August 22nd, 2011 07:34 AM
Turning a regular ASP.NET App into an AJAX ASP.Net donrafeal7 Ajax 2 August 31st, 2007 12:33 AM
Database diagram in .net using asp.net,c#.net scotttiger ADO.NET 2 February 16th, 2005 01:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.