SqlCommand connection object copied, not referenced ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?L2Rldi9udWxs?=

    #1

    SqlCommand connection object copied, not referenced ?

    Hello,
    i am using Visual Studio .NET 2003.
    I've set up a sqldataadapter using a sqlconnection for its selectcommand.
    All of it was created in the designer.

    I'd like to know how come this doesn't work like i thought it would work :

    In my Form_Load:
    Me.SqlConnectio n1 = nothing 'just testing here
    Me.SqlDataAdapt er1.Fill(Me.DsS tuff1.mytable1) 'still works, and i can see
    the old connection string in debugger ???

    I thought the SqlConnection of the selectcommand was just a reference
    (pointer) to the SqlConnection object. Feels like the data is just copied in
    there instead.

    Is there a way to make things work with a reference ?

    Thanks a lot
  • =?Utf-8?B?L2Rldi9udWxs?=

    #2
    RE: SqlCommand connection object copied, not referenced ?

    OOps, never mind, my problem isn't there...

    Someone explained it to me, sorry!

    "/dev/null" wrote:
    Hello,
    i am using Visual Studio .NET 2003.
    I've set up a sqldataadapter using a sqlconnection for its selectcommand.
    All of it was created in the designer.
    >
    I'd like to know how come this doesn't work like i thought it would work :
    >
    In my Form_Load:
    Me.SqlConnectio n1 = nothing 'just testing here
    Me.SqlDataAdapt er1.Fill(Me.DsS tuff1.mytable1) 'still works, and i can see
    the old connection string in debugger ???
    >
    I thought the SqlConnection of the selectcommand was just a reference
    (pointer) to the SqlConnection object. Feels like the data is just copied in
    there instead.
    >
    Is there a way to make things work with a reference ?
    >
    Thanks a lot

    Comment

    Working...