Problem with DataAdapter part 2

Posted on 2005-04-18
Last Modified: 2008-01-09
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?
Question by:jettman26
    LVL 10

    Expert Comment

    You have to put a primary key in your tables in sql server enterprise manager.

    Look at the yello Key.

    LVL 10

    Expert Comment

    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.

    Author Comment

    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?  
    LVL 10

    Accepted Solution

    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

    Author Comment

    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

    Author Comment

    I am just using this query:

    SELECT     info_id, class_name, info_date, notes
    FROM         Info
    LVL 10

    Expert Comment

    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.

    Author Comment

    It is under 8060 and was when I got the error in VS.NET.  It is now at 8059.
    LVL 10

    Expert Comment

    paste the table descripcion and all the code of visual studio.

    and why are your generating the ds with wizards?


    Author Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now