I'm trying to do something very straightforward in a 2.0 asp.net app with a
GridView - ObjectDataSource - DataSet.
I create a DataSet that accesses the NorthWind Customers Table - all columns
and I choose to generate all methods and updates. I connect this DataSet to
an ObjectDataSource and connect my DataView to the ObjectDataSource. (I did
not opt for optimistic concurrency) It displays just fine. Then I try to
change an address field in a row and get the error pasted below. The update
command that was generated is also pasted below. This is stuff right out of
textbooks. What is wrong?
Thanks,
T
ObjectDataSource 'ods2' could not find a non-generic method 'Update' that
has parameters: CompanyName, ContactName, ContactTitle, Address, City,
Region, PostalCode, Country, Phone, Fax, original_CustomerID.
UPDATE Customers
SET CustomerID = @CustomerID, CompanyName = @CompanyName,
ContactName = @ContactName, ContactTitle = @ContactTitle, Address =
@Address,
City = @City, Region = @Region, PostalCode =
@PostalCode, Country = @Country, Phone = @Phone, Fax = @Fax
WHERE (CustomerID = @Original_CustomerID) 3 2148
"Tina" <Ti**********@nospamexcite.comwrote in message
news:ek****************@TK2MSFTNGP03.phx.gbl...
I'm trying to do something very straightforward in a 2.0 asp.net app with
a GridView - ObjectDataSource - DataSet.
I create a DataSet that accesses the NorthWind Customers Table - all
columns and I choose to generate all methods and updates. I connect this
DataSet to an ObjectDataSource and connect my DataView to the
ObjectDataSource. (I did not opt for optimistic concurrency) It displays
just fine. Then I try to change an address field in a row and get the
error pasted below. The update command that was generated is also pasted
below. This is stuff right out of textbooks. What is wrong?
Thanks,
T
ObjectDataSource 'ods2' could not find a non-generic method 'Update' that
has parameters: CompanyName, ContactName, ContactTitle, Address, City,
Region, PostalCode, Country, Phone, Fax, original_CustomerID.
UPDATE Customers
SET CustomerID = @CustomerID, CompanyName = @CompanyName,
ContactName = @ContactName, ContactTitle = @ContactTitle, Address =
@Address,
City = @City, Region = @Region, PostalCode =
@PostalCode, Country = @Country, Phone = @Phone, Fax = @Fax
WHERE (CustomerID = @Original_CustomerID)
Hi Tina.
The problem could be caused by an incorrect setting in your
ObjectDataSource.Have you made sure the ObjectDataSource is configured not
to send original values together with your own parameters?
The ObjectDataSource OldValuesParameterFormatString property should not be
set if you want to send only your own parameters.
HTH
Ron.
OldValuesParameterFormatString was set to Original_{0} so I set it to blank
and the same thing happens.
T
"Ron" <no***@nowhere.comwrote in message
news:ea**************@TK2MSFTNGP02.phx.gbl...
"Tina" <Ti**********@nospamexcite.comwrote in message
news:ek****************@TK2MSFTNGP03.phx.gbl...
>I'm trying to do something very straightforward in a 2.0 asp.net app with a GridView - ObjectDataSource - DataSet.
I create a DataSet that accesses the NorthWind Customers Table - all columns and I choose to generate all methods and updates. I connect this DataSet to an ObjectDataSource and connect my DataView to the ObjectDataSource. (I did not opt for optimistic concurrency) It displays just fine. Then I try to change an address field in a row and get the error pasted below. The update command that was generated is also pasted below. This is stuff right out of textbooks. What is wrong?
Thanks, T
ObjectDataSource 'ods2' could not find a non-generic method 'Update' that has parameters: CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, original_CustomerID.
UPDATE Customers SET CustomerID = @CustomerID, CompanyName = @CompanyName, ContactName = @ContactName, ContactTitle = @ContactTitle, Address = @Address, City = @City, Region = @Region, PostalCode = @PostalCode, Country = @Country, Phone = @Phone, Fax = @Fax WHERE (CustomerID = @Original_CustomerID)
Hi Tina.
The problem could be caused by an incorrect setting in your
ObjectDataSource.Have you made sure the ObjectDataSource is configured not
to send original values together with your own parameters?
The ObjectDataSource OldValuesParameterFormatString property should not be
set if you want to send only your own parameters.
HTH
Ron.
"Tina" <Ti**********@nospamexcite.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
OldValuesParameterFormatString was set to Original_{0} so I set it to
blank and the same thing happens.
T
<snip>
OK, Tina.
Try removing the CustomerID = @CustomerID from your parameter list.
I wonder why you are using an ObjectDataSource and a DataSet when normally
an SqlDataSource works directly with a GridView. I set up an SqlDataSource
and a GridView to view and update the Northwind Customer Table without any
problem, but the Update SQL code in the SqlDataSource did not include a
CustomerID = @CustomerID, because CustomerID is the primary key of the
Customer table. So try changing your Update code to
UPDATE Customers
SET CompanyName = @CompanyName, ContactName = @ContactName,
ContactTitle = @ContactTitle, Address = @Address, City = @City, Region =
@Region, PostalCode = @PostalCode, Country = @Country, Phone = @Phone, Fax =
@Fax
WHERE (CustomerID = @Original_CustomerID)
You may have to change the WHERE clause to
WHERE (CustomerID = @CustomerID)
If that does not fix the problem, I suggest using an SqlDataSource instead
of the ObjectDataSource.
HTH
Ron. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: chonkme |
last post by:
Hi, i have a real simple xslt problem but i just cant figure out how
to do it by looking at various examples on the net. i have a xml
document and in it are some elements with a "result" tag name....
|
by: yossimotro |
last post by:
Hi,
I'm using a gridview in my project and its footer to add new records.
The gridview is connected to an AccessDataSource which contains select,
insert and delete commands.
The problem...
|
by: Frank |
last post by:
Hello All,
I am working with VS.NET 2005 and I have an editable GridView whose HTML
markup is shown below.
In short, when the user clicks on the Edit button, one of the textboxes is
replaced...
|
by: Frank |
last post by:
Hello All,
I am working with VS.NET 2005 and I have an editable GridView whose HTML
markup is shown below.
In short, when the user clicks on the Edit button, one of the textboxes is
replaced...
|
by: den 2005 |
last post by:
Hi everybody,
I created a Gridview with a TemplateField and there is Label control in
ItemTemplate and a DropdownList control in EditItemTemplate, I was to
displayed them ok when I click the...
| |
by: Richard Carpenter |
last post by:
I have a four-page tabcontrol with a gridview on each page. I have the
primary key column of each gridview set to hidden (visible = false),
but it still shows up on all but the first page. Anyone...
|
by: singh79 |
last post by:
Hi..
In My DropDown some Procedure Bind,My Drop Down name is Ddlpro ,(Bind By Table "PatProcedure") ,same Table PatProcedure again use and bind GridView ,In Gridviw I Can Take Template...
|
by: William LaMartin |
last post by:
On webform, I am populating a GridView from a SQLDatasource based on a MySQL
table named PIB.
There is no vb code involved. Everything is done in the source for the aspx
page, provided below. ...
|
by: nitindel |
last post by:
Hi All,
Please tell me any good site for Gridview control.(not for datagrid).
I am facing error in fetching the values of the Bound columns in the gridview:
lease tell me how should i...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |