On Aug 5, 11:09 pm, "John" <J...@nospam.infovis.co.uk> wrote:
> Hi
>
> Thanks. Not sure about the last point though, How do I implement
> transactions? Any link etc would be appreciated.
>
> Thanks
>
> Regards
>
> "Spam Catcher" <spamhoney...@rogers.com> wrote in message
>
> news:Xns9983EAED4EB32usenethoneypotrogers@127.0.0.1...
>
> > "John" <J...@nospam.infovis.co.uk> wrote in
> >news:(E-Mail Removed):
>
> >> before running a query do the trick or do I need to make more
> >> comprehensive checks?
>
> > Check the state of the connection.
>
> > I believe connection.state will give you the connection state. Just make
> > sure the connection is "Open".
>
> > You can also wrap your call in a try/catch - if it fails, repeat the call.
>
> > Lastly you may want to wrap your SQL in a transaction to prevent orphaned
> > records from being inserted.
You can search the help for DbTransaction (replace "Db" with your
provider (Sql/OleDb) for more specific help) or go to msdn.com and
search there. Both will bring up Microsoft's documentation for this.
Also, I believe it was Bill Vaughn that said that connection.State
will only tell you what it "thinks" it's state is - so this could
return a state of Open even if the connection has been lost - so make
sure you use a try.. catch just in case.
Thanks,
Seth Rowe
|