Click here to Skip to main content
15,890,947 members
Home / Discussions / C#
   

C#

 
Answeroracle exception Pin
yaswanth00111-Sep-12 7:19
yaswanth00111-Sep-12 7:19 
AnswerRe: oracle exception Pin
Andrei Straut11-Sep-12 7:28
Andrei Straut11-Sep-12 7:28 
AnswerRe: oracle exception Pin
Abhinav S11-Sep-12 7:56
Abhinav S11-Sep-12 7:56 
GeneralRe: oracle exception Pin
Pete O'Hanlon11-Sep-12 7:58
mvePete O'Hanlon11-Sep-12 7:58 
QuestionError Logging Pin
CodingYoshi11-Sep-12 3:26
CodingYoshi11-Sep-12 3:26 
AnswerRe: Error Logging Pin
Pete O'Hanlon11-Sep-12 3:47
mvePete O'Hanlon11-Sep-12 3:47 
GeneralRe: Error Logging Pin
CodingYoshi11-Sep-12 3:53
CodingYoshi11-Sep-12 3:53 
GeneralRe: Error Logging Pin
Pete O'Hanlon11-Sep-12 4:07
mvePete O'Hanlon11-Sep-12 4:07 
AnswerRe: Error Logging Pin
Eddy Vluggen11-Sep-12 5:18
professionalEddy Vluggen11-Sep-12 5:18 
AnswerRe: Error Logging Pin
Abhinav S11-Sep-12 7:50
Abhinav S11-Sep-12 7:50 
GeneralRe: Error Logging Pin
CodingYoshi11-Sep-12 13:57
CodingYoshi11-Sep-12 13:57 
GeneralRe: Error Logging Pin
Pete O'Hanlon11-Sep-12 22:17
mvePete O'Hanlon11-Sep-12 22:17 
QuestionHow to control mediaelement from the server terminal? Pin
ylchau10-Sep-12 23:10
ylchau10-Sep-12 23:10 
AnswerRe: How to control mediaelement from the server terminal? Pin
Pete O'Hanlon10-Sep-12 23:19
mvePete O'Hanlon10-Sep-12 23:19 
GeneralRe: How to control mediaelement from the server terminal? Pin
ylchau11-Sep-12 16:27
ylchau11-Sep-12 16:27 
GeneralRe: How to control mediaelement from the server terminal? Pin
Pete O'Hanlon11-Sep-12 22:42
mvePete O'Hanlon11-Sep-12 22:42 
QuestionDatagridview Sort By number Pin
mohammadkaab10-Sep-12 21:52
mohammadkaab10-Sep-12 21:52 
AnswerRe: Datagridview Sort By number Pin
Mycroft Holmes10-Sep-12 22:00
professionalMycroft Holmes10-Sep-12 22:00 
GeneralRe: Datagridview Sort By number Pin
mohammadkaab10-Sep-12 22:05
mohammadkaab10-Sep-12 22:05 
GeneralRe: Datagridview Sort By number Pin
Pete O'Hanlon10-Sep-12 22:19
mvePete O'Hanlon10-Sep-12 22:19 
GeneralRe: Datagridview Sort By number Pin
Mycroft Holmes10-Sep-12 22:38
professionalMycroft Holmes10-Sep-12 22:38 
QuestionConstructor in static class Pin
amit@iadept10-Sep-12 20:20
amit@iadept10-Sep-12 20:20 
AnswerRe: Constructor in static class Pin
Wayne Gaylard10-Sep-12 20:59
professionalWayne Gaylard10-Sep-12 20:59 
AnswerRe: Constructor in static class Pin
BobJanova11-Sep-12 0:21
BobJanova11-Sep-12 0:21 
No. How would you call it? Static constructors are called by the framework at a time which your code can't know*, and without any parameters. In fact the same construct in Java makes this clearer by just being

static {
 // code
}


... so it doesn't look like a callable method (which it isn't).

(*: It's called the first time the class is fully loaded, which I think happens when a method/field/property is called. However, you still don't know when that is because some other code might use the same class.)

If you want to preload state then you can have a parameter-accepting normal static method which you call in the Main procedure or via a static constructor elsewhere. (Obviously, you could call it from anywhere, but you want to call it before you are going to use the class at all, and Main is about the only place you can guarantee that.)
AnswerRe: Constructor in static class Pin
PIEBALDconsult11-Sep-12 3:20
mvePIEBALDconsult11-Sep-12 3:20 

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.