Problem with GetOrdinal



Hi,

I wrote a windows service in c# .net 2.0. There is a timer that fires
every second or so and when it does I start two threads (unless they are
still running from the last time).

One of the threads queries SQL server using a data reader. Every once
in a while I get a runtime related to GetOrdinal. Here is the call
stack:

at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String
fieldName)
at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name)
at GTS.ComAppLibrary.LXRecord.ReadRecords(SqlDataReader _dr)


I googled for this and I did find one posting on MSDN that goes back to
Nov of 2005. A number of people have had a similar problem, but nobody
seems to have a good solution.

Unfortunately I have just used a work around of supplying integers to
the GetString (and other get methods).


Is there a fix for this problem? Has MS been able to reproduce the
problem?


Thanks

Randy
.



Relevant Pages

  • RE: System.Timers.Timer bug : timer fires immediately/continously
    ... i have the same problem wir System.Timers.Timer in Windows Service ... > protected System.Threading.Timer timer; ... > // called when the timer fires ...
    (microsoft.public.dotnet.framework)
  • system.timer not firing
    ... >I have a simple Windows Service with a timer ... >The service seems to run just fine when I have the Timer ... but I think there is a maximum time that a timer ... fires for running total until you reach your max value. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: posix-cpu-timers revamp
    ... Tests with a process CPU timer set for a long expiration time. ... interval as set by setitimer. ... the first time it fires at the value set by setitimerbut from then on ... The current value of an itimer is a user feature, ...
    (Linux-Kernel)
  • Re: Windows Service Question
    ... and the timer firing issue went away. ... is not a Windows service at all, but a business class that is designed to ... you might consider using a ThreadPool to ... I asked the question about the clock time change and the timer, ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Timer in einem Service
    ... > bin ich auf die leichtgewichtigen timer ausgewichen ... ... [Problem with System.Timers.Timer not firing in a windows service] ... Vom Prinzip her ist die Threading.Timer-Variante noch geeignet für Services, ... Dipl.Inf. Frank Dzaebel ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)