Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
unhandled exception has occurred in your application if you click continue the application will bla bla bla ........and suggest me to insert JIT Compiler inside *.config file i tried this but also i'm getting same error....plz help me to find the solution.


UPDATE: Code from comments:

C#
public void datagridbind()
{
  dt = new DataTable();
  //dt.Columns.Add("SerNo", typeof(int));
  dt.Columns.Add("Column1", typeof(string));
  dt.Columns.Add("Column2", typeof(string));
  dt.Columns.Add("Column3", typeof(string));
  dt.Columns.Add("Column12", typeof(string));
  dt.Columns.Add("Column13", typeof(string));
  dt.Columns.Add("Column4", typeof(string));
  dt.Columns.Add("Column5", typeof(string));
  dt.Columns.Add("Column6", typeof(string));
  dt.Columns.Add("Column7", typeof(string));
  dt.Columns.Add("Column8", typeof(string));
  dt.Columns.Add("Column9", typeof(string));
  dt.Columns.Add("Column10", typeof(string));
  dt.Columns.Add("Column11", typeof(string));
  //this.dgvMulti.Columns["SerNo"].DataPropertyName = "SerNo";
  this.dgvMulti.Columns["Column1"].DataPropertyName = "Column1";
  this.dgvMulti.Columns["Column2"].DataPropertyName = "Column2";
  this.dgvMulti.Columns["Column3"].DataPropertyName = "Column3";
  this.dgvMulti.Columns["Column12"].DataPropertyName = "Column12";
  this.dgvMulti.Columns["Column13"].DataPropertyName = "Column13";
  this.dgvMulti.Columns["Column4"].DataPropertyName = "Column4";
  this.dgvMulti.Columns["Column5"].DataPropertyName = "Column5";
  this.dgvMulti.Columns["Column6"].DataPropertyName = "Column6";
  this.dgvMulti.Columns["Column7"].DataPropertyName = "Column7";
  this.dgvMulti.Columns["Column8"].DataPropertyName = "Column8";
  this.dgvMulti.Columns["Column9"].DataPropertyName = "Column9";
  this.dgvMulti.Columns["Column10"].DataPropertyName = "Column10";
  this.dgvMulti.Columns["Column11"].DataPropertyName = "Column11";
  this.dgvMulti.Columns["SerNo"].Width = 50;
  this.dgvMulti.Columns["Column1"].Width = 150;
  dgvMulti.DataSource = dt;
  dt.Clear();
}



and this was the error

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at HMS.frmRepairReplacementDockedId.datagridbind()
at HMS.frmRepairReplacementDockedId.frmRepairReplacementDockedId_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
HMS
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/PhoenixTechnologies/ComputerShoppe/HMS.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
BusinessLayer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/PhoenixTechnologies/ComputerShoppe/BusinessLayer.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
DllSign
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/PhoenixTechnologies/ComputerShoppe/DllSign.DLL
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
DataAccessLayer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/PhoenixTechnologies/ComputerShoppe/DataAccessLayer.DLL
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.7.0 built by: NETFXREL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
EntityLayer
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/PhoenixTechnologies/ComputerShoppe/EntityLayer.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitdebugging="true">


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Posted
Updated 15-Sep-15 19:56pm
v3
Comments
VR Karthikeyan 15-Sep-15 2:35am    
Show your code
Deepak Rai 15-Sep-15 4:58am    
Thanks for your reply Mr VR Karthikeyen,
Actually Under Load event of Form, i used datagridbind() function to bind the grid...
Here is the code:
<blockquote class="quote"><div class="op">Quote:</div>public void datagridbind()
{
dt = new DataTable();
//dt.Columns.Add("SerNo", typeof(int));
dt.Columns.Add("Column1", typeof(string));
dt.Columns.Add("Column2", typeof(string));
dt.Columns.Add("Column3", typeof(string));
dt.Columns.Add("Column12", typeof(string));
dt.Columns.Add("Column13", typeof(string));
dt.Columns.Add("Column4", typeof(string));
dt.Columns.Add("Column5", typeof(string));
dt.Columns.Add("Column6", typeof(string));
dt.Columns.Add("Column7", typeof(string));
dt.Columns.Add("Column8", typeof(string));
dt.Columns.Add("Column9", typeof(string));
dt.Columns.Add("Column10", typeof(string));
dt.Columns.Add("Column11", typeof(string));
//this.dgvMulti.Columns["SerNo"].DataPropertyName = "SerNo";
this.dgvMulti.Columns["Column1"].DataPropertyName = "Column1";
this.dgvMulti.Columns["Column2"].DataPropertyName = "Column2";
this.dgvMulti.Columns["Column3"].DataPropertyName = "Column3";
this.dgvMulti.Columns["Column12"].DataPropertyName = "Column12";
this.dgvMulti.Columns["Column13"].DataPropertyName = "Column13";
this.dgvMulti.Columns["Column4"].DataPropertyName = "Column4";
this.dgvMulti.Columns["Column5"].DataPropertyName = "Column5";
this.dgvMulti.Columns["Column6"].DataPropertyName = "Column6";
this.dgvMulti.Columns["Column7"].DataPropertyName = "Column7";
this.dgvMulti.Columns["Column8"].DataPropertyName = "Column8";
this.dgvMulti.Columns["Column9"].DataPropertyName = "Column9";
this.dgvMulti.Columns["Column10"].DataPropertyName = "Column10";
this.dgvMulti.Columns["Column11"].DataPropertyName = "Column11";
this.dgvMulti.Columns["SerNo"].Width = 50;
this.dgvMulti.Columns["Column1"].Width = 150;
dgvMulti.DataSource = dt;
dt.Clear();
}</blockquote> its working fine in my machine but throw an exception in client machine that you have to set jit compiler as true. I tried it but causes same problem. Please help me out.
VR Karthikeyan 16-Sep-15 1:03am    
Have you defined Columns in your datagrid(dgvMulti)? I have tested your code and I got Null reference exception when assigning DataPropertyName to the datagrid columns. because I have tested this without defining columns in datagrid. Check this.
Richard MacCutchan 15-Sep-15 4:10am    
Looks like the client machine is missing some component of .NET. Check that it has the same version installed as on your machine.

And please do not post updates to your question as Solutions, edit the question.
Naveen.Sanagasetti 15-Sep-15 6:19am    
Hi, if something is working fine in one environment and it is not working in other environment there might be problem in Configuration level or DB level please compare these 2 in both the environments and let us know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900