Executing a stored procedure that uses linked server from vb.NET

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mikael.Bergstrand@gmail.com

    Executing a stored procedure that uses linked server from vb.NET

    I can't execute my stored procedure from .NET (I think it might be
    because the stored proc has joins in it via linked servers). I get
    timeout error from .NET

    MyBase.connStri ng ="Integrated Security=SSPI;P ersist Security
    Info=False;Init ial Catalog=DB;Data Source=Server;"

    MyBase.selectSt ring = "Exec sp_storedproced ure1 var1,var2,var3"
    MyBase.GetDataS et()

    The stored procedure takes the 3 arguments and uses joins to 2 other
    db-servers that I have access to via linked server connections. (MS SQL
    Server)

    I can run the stored proc on in QA on my MS SQL with no prob.

    Must i open connections to the 2 linked servers from .NET as well?

    Glad for any opinions so i dont have to rewrite my sp,

    Mikael

  • bermik

    #2
    Re: Executing a stored procedure that uses linked server from vb.NET

    ....or does it have something to do with permissions on the linked
    server? Maybe .NET does not have access to the linked servers? On the
    other hand I thought that .Net would only start the sp as is, with the
    same result as if I started it in QA...

    /Mikael

    Comment

    • bermik

      #3
      Re: Executing a stored procedure that uses linked server from vb.NET

      ....I wrote a smaller sp to test if it was the linked server that made a
      mess. But it turns out that it worked out fine. Therefore it is not a
      matter of login or linked server. I figure it might be the fact that
      the sp takes about 15 min to execute. I have tried to set the
      ..cmdTimeout = 15000. Is there a way to set the connection time also?

      /Mikael

      Comment

      • bermik

        #4
        Re: Executing a stored procedure that uses linked server from vb.NET

        .......and timeout problem it was!

        (MyBase.cmdTime out = 15000)


        topic.close() //Mikael

        Comment

        • bermik

          #5
          Re: Executing a stored procedure that uses linked server from vb.NET

          .......and timeout problem it was!

          (MyBase.cmdTime out = 15000)


          topic.close() //Mikael

          Comment

          Working...