system err while calling fill method of 2nd data adapter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rachana

    #1

    system err while calling fill method of 2nd data adapter

    Hi,
    I am having vb2003-net 1.1

    Code was working fine yesterday, today getting error
    -----------------------------------------------------------
    error:
    An unhandled exception of type 'System.Data.Sq lClient.SqlExce ption'
    occurred in system.data.dll
    Additional information: System error.
    -----------------------------------------------------------
    Last line is highlighted. error while calling method for second data
    adapter
    -----------------------------------------------------------
    My Code is :
    Dim mDataSet As New DataSet()

    Dim mConn As New SqlConnection()
    mConn.Connectio nString = "Data Source=localhos t;initial
    catalog=transpo rt;integrated security=XXX"
    mConn.Open()

    Dim mStr1 As String = "select * from mItem"
    Dim mStr2 As String = "select * from mPump"

    Dim mAdapter1 As New SqlDataAdapter( mStr1, mConn)
    mAdapter1.Fill( mDataSet, "mItem")

    Dim mAdapter2 As New SqlDataAdapter( mStr2, mConn)
    mAdapter2.Fill( mDataSet, "mPump")
    --------------------------------------------------------------

    Need help...

    Thanks,
    Regards,

    Rachana

  • Cor Ligthert [MVP]

    #2
    Re: system err while calling fill method of 2nd data adapter

    Rachana,

    Probably if you remove the
    mConn.Open
    it will work.

    The dataadapter does its own opening of the connection as long as that is
    not opened already.

    Cor

    "Rachana" <mbs.rachana@gm ail.comschreef in bericht
    news:1178596745 .466935.194880@ u30g2000hsc.goo glegroups.com.. .
    Hi,
    I am having vb2003-net 1.1
    >
    Code was working fine yesterday, today getting error
    -----------------------------------------------------------
    error:
    An unhandled exception of type 'System.Data.Sq lClient.SqlExce ption'
    occurred in system.data.dll
    Additional information: System error.
    -----------------------------------------------------------
    Last line is highlighted. error while calling method for second data
    adapter
    -----------------------------------------------------------
    My Code is :
    Dim mDataSet As New DataSet()
    >
    Dim mConn As New SqlConnection()
    mConn.Connectio nString = "Data Source=localhos t;initial
    catalog=transpo rt;integrated security=XXX"
    mConn.Open()
    >
    Dim mStr1 As String = "select * from mItem"
    Dim mStr2 As String = "select * from mPump"
    >
    Dim mAdapter1 As New SqlDataAdapter( mStr1, mConn)
    mAdapter1.Fill( mDataSet, "mItem")
    >
    Dim mAdapter2 As New SqlDataAdapter( mStr2, mConn)
    mAdapter2.Fill( mDataSet, "mPump")
    --------------------------------------------------------------
    >
    Need help...
    >
    Thanks,
    Regards,
    >
    Rachana
    >

    Comment

    Working...