🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.lang.csharp
Article #514

DataSet i DataAdapter

#514
From: Robert G
Date: Thu, 19 Feb 2004 09:16
19 lines
1827 bytes
Witam
Wie ktos moze na jakiej postrawie DataAdapter decuduje o wywolaniu komendu
Insert lub Update ?
Zrobilem sobie prosta formatek ktora ma jedno pole tekstowe. Pole jest
bindowane do obeiktu dataset ktory zawiera prosta tabele
Typy(TypID(autonumer),Typ(string)) Na pole tekstowe zalozony jest unikalny
indeks.
Wpisuje do pola tekstoweog nazwe typu np. Typ1. Jezeli w bazie nie ma
takiego typu to sie dodaje. Jezeli typ jest to wyskakuje wyjatek ze nie moze
dodac. Po wylapaniu wyjatku, zmieniam pole na wartosc nie istniejaca w
bazie. Wywaoluje DatatAdapter.Update(myDataSet,"Typy"), i dostaje wyjatek :
"... element CommandUpdate dotyczy zerowej liczby rekordow. W zdarzeniu
RowUpdated EventArg ma stan Updat. W myDataSet mam rekord z wartoscia nie
istniejaca w bazie ?! Ktos wie jak zresetowac po pierwszej nieudanej probie
dataadapter lub cos co decuduje ze dataadapter wywoluje komende Update a nie
Insert ?!

Z gory thx za pmoc
Robert G
Technical Details
Message-ID: <c11v15$ir0$1@nemesis.news.tpi.pl>
Path: mbox-mo1.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail
From: "Robert G" <zof...@interia.pl>
Newsgroups: alt.pl.comp.lang.csharp
Subject: DataSet i DataAdapter
Date: Thu, 19 Feb 2004 10:16:48 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 21
Message-ID: <c11v15$ir0$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: yp234.internetdsl.tpnet.pl
X-Trace: nemesis.news.tpi.pl 1077182310 19296 80.55.249.234 (19 Feb 2004 09:18:30 GMT)
X-Complaints-To: use...@tpi.pl
NNTP-Posting-Date: Thu, 19 Feb 2004 09:18:30 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit