console app timer problem

jvcoach23

Well-known member
Joined
May 22, 2003
Messages
192
Location
Saybrook, IL
Im 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 Ive 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 doesnt run any of the code under the web service retrieval. I put a try and catch in there with an exception but its not failing.. just not running to what I would have thought was correct.
Here is the code..
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

Code:
<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
 
How long does the web service take to return? You may find that it is firing the timer, calling the WS and then the timer is firing again before the WS returns.
 
is there a different spot that I should post this question to.. Ill create a new post if there is.. would like to get this thing working..

thanks
shannon
 
PlausiblyDamp said:
How long does the web service take to return? You may find that it is firing the timer, calling the WS and then the timer is firing again before the WS returns.


looks like the ws is returing almost instantly.
 
Back
Top