Robin
Fri Mar 16 20:35:47 CDT 2007
Ooops, nope, I'm not Microsoft; that was bad setup of my newsgroup
account...
Anyway, I am looking for specific information about working with the
dataset designer; I don't have access to the Command objects, that I can
see.
"William (Bill) Vaughn" <billvaRemoveThis@nwlink.com> wrote in message
news:%2389BK2CaHHA.4552@TK2MSFTNGP05.phx.gbl...
> Please change your "from" address--clearly you're not from "Microsoft"
>
> Ah, that's the rub. When you create a DataReader (as I expect you're
> doing), you must set the CommandBehavior.CloseConnection option so that
> when some other routine finishes with the DataReader it can be
> closed--even in an Exception handler.
>
> See Chapter 6.
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> INETA Speaker
> www.betav.com/blog/billva
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Microsoft" <robinne123@newsgroups.nospam> wrote in message
> news:OkBEWz$ZHHA.208@TK2MSFTNGP05.phx.gbl...
>>I have been going through some tutorials on using the new dataset designer
>>in Visual Studio 2005 to build dataadapters which include inserts,
>>updates, and deletes...so I don't have to code it all by hand. This
>>tutorial is tutorial #1 located here
>>
http://www.asp.net/learn/dataaccess/default.aspx?tabid=63.
>>
>> When I call my dataadapter insert statement, and my insert is invalid
>> (e.g. wrong permissions on my database or trying to insert null value
>> into column that requires value input), I am able to log the exception
>> that is thrown, but my database then 'chokes' because it seems the
>> connection did not get closed properly. The databsae thinks it still has
>> a connection to it.
>>
>> Since I have not hand coded the connection, I don't know how to close it
>> when an exception is thrown (I don't think have access to the connection
>> object). Normally I would close a connection in my finally statement.
>>
>> Please advise. Thanks.
>>
>>
>>
>
>