Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Problem with DataAdapter part 2

I asked a question like this not long ago and thought it was resolved.  Apparently it is not.

Not sure if this question should be in this forum or MSSQL.
I am creating a small Web App.  I am using VS.NET 2003 and MSSQL database.  I have two tables.  I use the Data Adapter Configuration Wizard and add a new connection and then use the query builder.  My query is
'SELECT     class_name, info_date, notes
FROM         info'.

When I get to the View Wizard Results page, I get the following problems and don't know how to fix them.  

'Generated UPDATE statement.
Could not determine which columns uniquely identify the rows for "info".'

'Generated DELETE statement.
Could not determine which columns uniquely identify the rows for "info".'

I need to be able to update and delete from my database.  
I think this may be the reason why I can't seem to update my database.

The two tables:

     class_info   (Primary Key)

     class_info   (Foreign Key to class_info in Classes table)

I think VS.NET doesn't like that I have no Primary Key in my Info table.  I don't necessarily want to add a primary key if I don't have to.  
Anyone know a way around this?
  • 5
  • 5
1 Solution
You have to put a primary key in your tables in sql server enterprise manager.

Look at the yello Key.

You have to add. It. Not adding primary key to tables for single they are. ITS VERY BAD PRACTICE. VERY BAD...
Sorry for the Caps..

but thats what experts says.
jettman26Author Commented:
Ok, I added a new column to Info called info_id and made it the primary key.
No I get the following error.

'Classes' table saved successfully
'Info' table
- Unable to modify table.  
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]Creation of table 'Tmp_Info' failed because the row size would be 8075, including internal overhead. This exceeds the maximum allowable table row size, 8060.
What is magic about 8060?  Can I increase it?  
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

the size on your  columns are bigger than 8060 and they cant be.

You cant put for example 5 columns of varchar 2000

You can replace them for text columns for example
jettman26Author Commented:
I made it so it would be within 8060.

Now this is what the Info table looks like.
info_id   (Primary Key)
class_name   (Foreign Key to class_name in the Classes table)

Now I am getting the a little bit different error message again in VS.NET when I try to figure the dataAdapter.

Generated UPDATE statement.
There were errors configuring the data adapter.

Generated DELETE statement.
There were errors configuring the data adapter
jettman26Author Commented:
I am just using this query:

SELECT     info_id, class_name, info_date, notes
FROM         Info
This exceeds the maximum allowable table row size, 8060.

What part didnt you understand It doesnt matter what you select your table cant contains more than 8060 bytes.
jettman26Author Commented:
It is under 8060 and was when I got the error in VS.NET.  It is now at 8059.
paste the table descripcion and all the code of visual studio.

and why are your generating the ds with wizards?

jettman26Author Commented:
I rolled back a couple of changes on my database and it worked fine.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now