Click here to Skip to main content
15,920,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: Threads appear twice Pin
James Simpson24-Oct-03 2:03
James Simpson24-Oct-03 2:03 
QuestionEditcontrol GUI widget.. Any Tips? Pin
kfowlks21-Oct-03 4:32
kfowlks21-Oct-03 4:32 
AnswerRe: Editcontrol GUI widget.. Any Tips? Pin
J. Dunlap21-Oct-03 12:14
J. Dunlap21-Oct-03 12:14 
GeneralRe: Editcontrol GUI widget.. Any Tips? Pin
kfowlks22-Oct-03 4:16
kfowlks22-Oct-03 4:16 
General__LINE__ Pin
Rick Crone21-Oct-03 3:53
Rick Crone21-Oct-03 3:53 
GeneralRe: __LINE__ Pin
Rick Crone21-Oct-03 5:51
Rick Crone21-Oct-03 5:51 
GeneralRe: __LINE__ Pin
Heath Stewart21-Oct-03 6:39
protectorHeath Stewart21-Oct-03 6:39 
GeneralRe: __LINE__ Pin
Rick Crone21-Oct-03 7:53
Rick Crone21-Oct-03 7:53 
Thank you for your reply! I'm currently working on some services and I'm not seeing the line number when I catch an exception.

Maybe it's because I handled the exception - by exiting my service but this is an example of what my exception reports:

System.Data.SqlClient.SqlException: SHUTDOWN is in progress. Log off.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
at GetAcc.GetAcc.timer1_Elapsed(Object sender, ElapsedEventArgs e)

I want the line number so I know where (which exception trap) trapped the error. In a case like the example above (depending on what step I'm in in my process) I may be able to keep my service alive until the SQL server is available again.

I have found that I can use Environment.StackTrace which gives more info... but does include the line number. So I'm adding that to my message that I log to a file.
GeneralRe: __LINE__ Pin
Heath Stewart21-Oct-03 8:36
protectorHeath Stewart21-Oct-03 8:36 
GeneralRe: __LINE__ Pin
Rick Crone21-Oct-03 9:43
Rick Crone21-Oct-03 9:43 
GeneralRe: __LINE__ Pin
leppie21-Oct-03 8:42
leppie21-Oct-03 8:42 
GeneralRe: __LINE__ Pin
J. Dunlap21-Oct-03 9:01
J. Dunlap21-Oct-03 9:01 
QuestionHow can I get graphics through message WM_NCPAINT ? Pin
wangier20-Oct-03 23:24
wangier20-Oct-03 23:24 
AnswerRe: How can I get graphics through message WM_NCPAINT ? Pin
Heath Stewart21-Oct-03 6:41
protectorHeath Stewart21-Oct-03 6:41 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier21-Oct-03 15:08
wangier21-Oct-03 15:08 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
Heath Stewart21-Oct-03 18:57
protectorHeath Stewart21-Oct-03 18:57 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier21-Oct-03 23:40
wangier21-Oct-03 23:40 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
Heath Stewart22-Oct-03 2:59
protectorHeath Stewart22-Oct-03 2:59 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier22-Oct-03 15:44
wangier22-Oct-03 15:44 
GeneralRe: How can I get graphics through message WM_NCPAINT ? Pin
wangier21-Oct-03 17:24
wangier21-Oct-03 17:24 
QuestionHow can I capture the screen with cursor? Pin
qiuji20-Oct-03 22:52
qiuji20-Oct-03 22:52 
AnswerRe: How can I capture the screen with cursor? Pin
Heath Stewart21-Oct-03 6:47
protectorHeath Stewart21-Oct-03 6:47 
GeneralControl Button Doubleclick Pin
Mr. Labenche20-Oct-03 21:46
Mr. Labenche20-Oct-03 21:46 
GeneralRe: Control Button Doubleclick Pin
Heath Stewart21-Oct-03 6:51
protectorHeath Stewart21-Oct-03 6:51 
GeneralRe: Control Button Doubleclick Pin
Mr. Labenche21-Oct-03 23:16
Mr. Labenche21-Oct-03 23:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.