Re: Adding a parent for existing child row. (typed datasets)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Sahil Malik (contactmethrumyblog_at_nospam.com)
Date: 11/02/04


Date: Tue, 2 Nov 2004 01:43:20 -0500

Run a trace, see the query being generated by ado.net for you - chances are
it is not what you expect it to be. Specify your own query explicitly that
does exactly what you want it to do.

Also, the problem could be in other areas too as per the description
mentioned below; but the above is a high probability hit !! :-)

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik

"news.microsoft.com" <mariusht_dontwantanyspamsoremovethis_@hotmail.com>
wrote in message news:ekAXj%23GwEHA.2876@TK2MSFTNGP12.phx.gbl...
>I have two database tables USER N - 1 PICTURE. (one picture can be chosen
>by many users). A lot of users have not yet selected a picture, so the
>foreign key pictureID in the USER-table is NULL.
>
> I use typed datasets and use the VS.Net wizards to create dataadapters and
> tables withing the datasets. I set the relationships myself and use
> seed -1 and increment -1 and autoincrement true.
>
> When I load my data into the datasets, I will have lots of children
> (users) without parents (pictures). For one user I upload a picture, add a
> new PictureRow in the myDataSet.Picture array and call
> myDataAdapter.update(myDataSet, "PICTURE"). I then get this annoying
> exception:
>
> Prepared statement '(@username nvarchar(20),@password
> nvarchar(20),@lastlogin date' expects parameter @username, which was not
> supplied.
>
> I dont understand this... Can anyone point me in the right direction so i
> can help my orphanes get parents?
>
> (I'm using SQL Server 2k, identity keys and db referential integrity)
>
> --
> Marius



Relevant Pages

  • MS Access/VBA Question - Using Multiple combo Boxes to Search on a Form
    ... -I have a form with several combo boxes and several text ... a button is clicked which launches a new form (frmResults). ... frmResults is bound to a query, the criteria of which is set to the ... specify anything for a particular field. ...
    (microsoft.public.office.developer.vba)
  • Re: Clearing all fields with code problem
    ... In a saved query you could use the following as criteria ... The cards are assigned to staff in our building, so the card is either blank, I.e no one has that card or someone has the card and the record is filled in. ... There is only one table apart from several small tables that populate the drop down boxes. ... What code should I enter that will check if there is any thing to delete in my OLE picture field ...
    (microsoft.public.access.gettingstarted)
  • Re: Custom property data type
    ... an error that a date was expected, but with my "Date Picture Taken" ... >> window of Indexing Services and I am able to query by this file property ... >> what to set the datatype to in Property window on Index Server. ...
    (microsoft.public.inetserver.indexserver)
  • Re: ASP / Access: use of same table twice in one query
    ... are in the same table and I need them both in one query. ... I agree it is better to specify the fields I need in the select statement, ... >> The data is stored in an Access database. ... > quicker response by posting to the newsgroup. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Query records with single Dates Automatically
    ... both queries pull from the same table. ... -- Two Tables Attendees and Visits ... Please copy and post the SQL of your query. ... I have to find a way to specify ...
    (microsoft.public.access.queries)