Click here to Skip to main content
15,886,840 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Set Position of Controls according to Form Size Pin
Giorgi Dalakishvili16-Nov-08 0:35
mentorGiorgi Dalakishvili16-Nov-08 0:35 
QuestionAdding Textbox and button in column of the datagridView Pin
mohamed samir abdeen12-Nov-08 11:53
mohamed samir abdeen12-Nov-08 11:53 
AnswerRe: Adding Textbox and button in column of the datagridView Pin
Thomas Stockwell14-Nov-08 2:59
professionalThomas Stockwell14-Nov-08 2:59 
QuestionRTF file in Rich Text BOx Pin
raushan_911-Nov-08 19:57
raushan_911-Nov-08 19:57 
AnswerRe: RTF file in Rich Text BOx Pin
Thomas Stockwell14-Nov-08 2:58
professionalThomas Stockwell14-Nov-08 2:58 
QuestionHow to detect printer status in vb.net or c# Pin
raja baireddy11-Nov-08 18:50
raja baireddy11-Nov-08 18:50 
AnswerRe: How to detect printer status in vb.net or c# Pin
Simon P Stevens11-Nov-08 23:42
Simon P Stevens11-Nov-08 23:42 
QuestionThe type initializer for 'DataAccessLayer.Method' threw an exception. Pin
Illegal Operation11-Nov-08 18:02
Illegal Operation11-Nov-08 18:02 
I am at a loss. Can someone PLEASE help me with the above error message?

I have a Windows Application with a PresentationLayer, DataAccessLayer, BusinessLogicLayer and Web Service for Client Application Services.

When I run my app it executes as follows:

I login using the loginform. Upon login a new form is opened and the form_load event executes. When this happens the following line executes -
var _bllEntities = new BLLEntities();
. It then jumps to my BLLEntities.cs file where the following line executes -
readonly Entities DALEntities = new Entities();
. It is at this line where VS tells me that the Type initializer for DAL.Method threw an exception.

The innerexception tells me that I need to use the "new" keyword that I have as you can see, and the second innerexception tells me to check if the object is null before calling the method.

How can I check this as I have
var _bllEntities = new BLLEntities();
declared right after the class namespace. I cannot use if or switch.

Thank you!!

Illegal Operation

AnswerRe: The type initializer for 'DataAccessLayer.Method' threw an exception. Pin
Simon P Stevens12-Nov-08 0:01
Simon P Stevens12-Nov-08 0:01 
GeneralRe: The type initializer for 'DataAccessLayer.Method' threw an exception. Pin
Illegal Operation12-Nov-08 12:33
Illegal Operation12-Nov-08 12:33 
GeneralRe: The type initializer for 'DataAccessLayer.Method' threw an exception. Pin
Simon P Stevens12-Nov-08 21:37
Simon P Stevens12-Nov-08 21:37 
QuestionHow to display text on the Datagridview Header? Pin
Soma Shekhar11-Nov-08 7:30
Soma Shekhar11-Nov-08 7:30 
AnswerRe: How to display text on the Datagridview Header? Pin
Dave Kreskowiak12-Nov-08 4:08
mveDave Kreskowiak12-Nov-08 4:08 
GeneralRe: How to display text on the Datagridview Header? Pin
Soma Shekhar12-Nov-08 5:21
Soma Shekhar12-Nov-08 5:21 
GeneralRe: How to display text on the Datagridview Header? Pin
Dave Kreskowiak12-Nov-08 12:16
mveDave Kreskowiak12-Nov-08 12:16 
GeneralRe: How to display text on the Datagridview Header? Pin
Paul Conrad12-Nov-08 12:45
professionalPaul Conrad12-Nov-08 12:45 
QuestionHow to save the Windows current view and reload when next time the application is started? Pin
Soma Shekhar11-Nov-08 7:20
Soma Shekhar11-Nov-08 7:20 
AnswerRe: How to save the Windows current view and reload when next time the application is started? Pin
Richard Blythe11-Nov-08 16:18
Richard Blythe11-Nov-08 16:18 
GeneralRe: How to save the Windows current view and reload when next time the application is started? Pin
Soma Shekhar11-Nov-08 17:00
Soma Shekhar11-Nov-08 17:00 
GeneralRe: How to save the Windows current view and reload when next time the application is started? Pin
Richard Blythe11-Nov-08 17:18
Richard Blythe11-Nov-08 17:18 
QuestionHow to show a value in an Edit Textbox Pin
J_E_D_I10-Nov-08 8:35
J_E_D_I10-Nov-08 8:35 
AnswerRe: How to show a value in an Edit Textbox Pin
Dave Kreskowiak10-Nov-08 12:58
mveDave Kreskowiak10-Nov-08 12:58 
Questionlistbox Pin
sram1510-Nov-08 0:22
sram1510-Nov-08 0:22 
AnswerRe: listbox Pin
ScottM112-Nov-08 1:23
ScottM112-Nov-08 1:23 
Questionhow to simulate the image layer , like the one in Photoshop Pin
Member 41517587-Nov-08 4:27
Member 41517587-Nov-08 4:27 

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.