Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to code a what I thought would be a simple timer app in a console. The problem is the code runs fine the first time through, then it sits there for 5 seconds like I've asked the timer to do and it goes to run through it again, but it go to retrieve data to a dataset from a web service (the same call it had just made and worked on) and when it hits the web service retrieval, it just hops back up to the top of the sub again.. it doesn't run any of the code under the web service retrieval. I put a try and catch in there with an exception but it's not failing.. just not running to what I would have thought was correct.

Here is the code..

Sub GetPerfmonInfo()

       counter = counter + 1
       Debug.WriteLine(counter)

       Dim intTblPMInstanceId As Integer
       Dim vcCategoryName As String
       Dim vcCounterName As String
       Dim vcServer As String
       Dim vcInstance As String

       Dim ds As New DataSet
       Dim dsCount As Integer  'Number of columns in dataset

       Try
           ds = wsPerfmon.spPMCountersToQueryForCompany("Home")
       Catch ex As Exception
           Throw ex
       End Try


       dsCount = ds.Tables.Count

 

there is some stuff it does in there more than that.. but it never gets past the ds = on the second time through.

 

Here is the web service info

 

<WebMethod()> _
   Public Function spPMCountersToQueryForCompany(ByVal vcCompanyName As String) As DataSet
       Dim cn As SqlConnection
       Dim cm As New SqlCommand
       Dim da As New SqlDataAdapter
       Dim ds As New DataSet


       cn = New SqlConnection("pwd=password; UID=sa; server=www.site.us; database=network")
       cm = New SqlCommand("spPMCountersToQueryForCompany", cn)
       cm.CommandType = CommandType.StoredProcedure
       cm.Parameters.Add("@vcCompanyName", SqlDbType.VarChar).Value = vcCompanyName

       da.SelectCommand = cm

       cn.Open()
       cm.ExecuteNonQuery()
       cn.Close()
       cm = Nothing
       cn = Nothing


       da.Fill(ds, "Perfmon")
       Return ds

   End Function

 

can anyone help me out

thanks

JvCoach23

VB.Net newbie

MS Sql Vet

Posted

is there a different spot that I should post this question to.. I'll create a new post if there is.. would like to get this thing working..

 

thanks

shannon

JvCoach23

VB.Net newbie

MS Sql Vet

Posted
How long does the web service take to return? You may find that it is firing the timer' date=' calling the WS and then the timer is firing again before the WS returns.[/quote']

 

 

looks like the ws is returing almost instantly.

JvCoach23

VB.Net newbie

MS Sql Vet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...