jvcoach23 Posted September 10, 2004 Posted September 10, 2004 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 Quote JvCoach23 VB.Net newbie MS Sql Vet
Administrators PlausiblyDamp Posted September 13, 2004 Administrators Posted September 13, 2004 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jvcoach23 Posted September 13, 2004 Author Posted September 13, 2004 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 Quote JvCoach23 VB.Net newbie MS Sql Vet
jvcoach23 Posted September 13, 2004 Author Posted September 13, 2004 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. Quote JvCoach23 VB.Net newbie MS Sql Vet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.