473,546 Members | 2,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with ObjectDataSourc e 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 ObjectDataSourc e 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. "ObjectDataSour ce 'ods_SingleTile ' could not find a non-generic
method 'Update' that has parameters: Tile_Number, Tile_Name, Tile_Path,
Value, Sold, Payment_Verifie d, Owner_Type, Line_1, Line_2, First_Name,
Last_Name, Company, Address, State, Postcode, Country, Email, Phone,
Original_Tile_N umber, [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 2481
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 ObjectDataSourc e 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. "ObjectDataSour ce 'ods_SingleTile ' could not find a non-generic
method 'Update' that has parameters: Tile_Number, Tile_Name, Tile_Path,
Value, Sold, Payment_Verifie d, Owner_Type, Line_1, Line_2, First_Name,
Last_Name, Company, Address, State, Postcode, Country, Email, Phone,
Original_Tile_N umber, [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
8673
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 update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action...
5
1970
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 parameter. When the Update-method is invoked by the ObjectDataSource, the object referenced is not the same object returned by the Select-method, but a...
4
3386
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 RaiseCallbackEvent(string eventArgs) { // update the data object with the values currently on screen FormView1.UpdateItem(true); }
7
3434
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 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is...
3
2152
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 and I choose to generate all methods and updates. I connect this DataSet to an ObjectDataSource and connect my DataView to the ObjectDataSource. (I...
2
3912
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 UpdateMethod? I can pass the ListItemCollection in a ControlParameter, e.g.
1
1683
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 collections of textboxes prompting for entry into a fairly monolithic database. I decided to create a business object (called Employee) and use the...
1
5405
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 update method that accepts a strongly typed data table as parameters. We have to have an update method with all data table's columns as its parameter....
0
1085
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 presentation layer. They are all properly referenced up the line. Data manipulation is via stored procedures in a SQL Server 2005 database. For the data...
0
7435
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7698
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7461
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7794
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6030
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3472
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1922
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
747
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.