Problem with ObjectDataSource Update method

G

Guest

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.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top