473,396 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with ObjectDataSource Update method

VB.NET 2.0 project...
I have an Access database with a table that has one primary key. I have used
the Add TableAdapter wizard in VS2005 to create my TableAdapter. Next I added
an ObjectDataSource object to a new aspx form, chosen the newly created
TableAdapter and selected the parameterised Update command from the drop list
provided. Finally I added a GridView control and bound it to the ODS.

The problem I have is an error I get when clicking Update after an edit on
the gridview. "ObjectDataSource 'ods_SingleTile' could not find a non-generic
method 'Update' that has parameters: Tile_Number, Tile_Name, Tile_Path,
Value, Sold, Payment_Verified, Owner_Type, Line_1, Line_2, First_Name,
Last_Name, Company, Address, State, Postcode, Country, Email, Phone,
Original_Tile_Number, [Tile Number], [Tile Path], [Payment Verified], [Owner
Type], [Line 1], [Line 2], [First Name], [Last Name], original_Tile Name. "

The primary key in my table is "Tile Name" and I have checked that the
gridview has this Read Only set to False for this field. I have tried setting
this to True also with no improvement. I've also tried not using this field
in the gridview at all.

I have even gone back to scratch with the table and tried removing the
promary key altogether, but unfortunately the DataTable wizard in VS2005
won't generate an UPDATE statement for a table without a primary key.

I'm totally at a loss here. i have looked back at other VB.NET projects
where I've successfully used an updatable GridView in conjunction with Access
tabales with primary keys. Apart from the obvious differences in table and
field names I can't for the life of me figure out what I'm doing wrong this
time round. Any help or perals of wisdom would be greatly appreciated.

May 1 '06 #1
1 2461
After a couple of days of going round and round in circles I have finally
discovered what the problem is. Make sure your tables in Access have no
spaces in the field names. That's it! *groan* I tested by putting a space
back in and got the original error - duplicated fields names in the update
function signature. I'm going out on a limb here and declaring this a bug
with Framework 2. I base this on the fact that nowhere in the code was the
problem evident. It seems to be invented at runtime by the ODS object.

Hope others can benefit
"Scott F K Hooper" wrote:
VB.NET 2.0 project...
I have an Access database with a table that has one primary key. I have used
the Add TableAdapter wizard in VS2005 to create my TableAdapter. Next I added
an ObjectDataSource object to a new aspx form, chosen the newly created
TableAdapter and selected the parameterised Update command from the drop list
provided. Finally I added a GridView control and bound it to the ODS.

The problem I have is an error I get when clicking Update after an edit on
the gridview. "ObjectDataSource 'ods_SingleTile' could not find a non-generic
method 'Update' that has parameters: Tile_Number, Tile_Name, Tile_Path,
Value, Sold, Payment_Verified, Owner_Type, Line_1, Line_2, First_Name,
Last_Name, Company, Address, State, Postcode, Country, Email, Phone,
Original_Tile_Number, [Tile Number], [Tile Path], [Payment Verified], [Owner
Type], [Line 1], [Line 2], [First Name], [Last Name], original_Tile Name. "

The primary key in my table is "Tile Name" and I have checked that the
gridview has this Read Only set to False for this field. I have tried setting
this to True also with no improvement. I've also tried not using this field
in the gridview at all.

I have even gone back to scratch with the table and tried removing the
promary key altogether, but unfortunately the DataTable wizard in VS2005
won't generate an UPDATE statement for a table without a primary key.

I'm totally at a loss here. i have looked back at other VB.NET projects
where I've successfully used an updatable GridView in conjunction with Access
tabales with primary keys. Apart from the obvious differences in table and
field names I can't for the life of me figure out what I'm doing wrong this
time round. Any help or perals of wisdom would be greatly appreciated.

May 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
5
by: Ole M | last post by:
I'm having some trouble using the ObjectDataSource in ASP.NET 2.0. I have a wrapper that contains the static methods for Select and Update. The Update-method takes the business object as...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
3
by: Tina | last post by:
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...
2
by: J055 | last post by:
Hi I have a method with the following signature: public bool UpdateSetAccounts(int items) { } How do I pass a collection of selected values in a ListBox to this ObjectDataSource...
1
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I really hope this is not a case of "this silly thing will never work".....lots of time invested in troubleshooting this already. I have created a standard ASP.NET web form (.aspx) with several...
1
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an...
0
by: SteveT | last post by:
I created an asp.net website which works fine. I then tried to recreate it as a series of Web Application Projects, one project for the data layer, one for the business layer and one for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
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...
0
agi2029
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.