CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Posts
    19

    An exception caused by Primary Key

    Hi,

    I'm using the ADO.NET with C#. When I perform an SQL query on a table in which the primary key consists of multiple fields and the SQL query is done on fewer fields than the primary key I get an exception.
    ("No value given for one or more required parameters")
    I get why this may not be allowed, but I could to this in the old ADO.
    (let's say I want all the x's of y, then y & x consist of the primary key, but I still need to create a query that returns all the x's of a certain y)

    Does anybody know if they changed that? or do I need to do something else.

    Thanks!

  2. #2
    Join Date
    Jul 2004
    Location
    Jakarta, Indonesia
    Posts
    596

    Re: An exception caused by Primary Key

    can u post the dbase design u made and tell us what are the result that u want from that design? coz it seem hard to figure it out what u want to achieve from words..

    but from the error u get..it seems that ur query need 'Value' for it which u omitted it

    1st NF - a table should not contain repeating groups.
    2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
    3rd NF - there should be no dependency between non key fields in same table.
    - E. Petroutsos -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL

  3. #3
    Join Date
    Jul 2004
    Location
    Chennai, India
    Posts
    1,064

    Thumbs up Re: An exception caused by Primary Key

    It seems that your query has the field which is not the field of table. Check column names properly

    Madhivanan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured