Object reference not set to an instance of an object.

Feb 21, 2014 at 3:57 PM
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=SharpCore.Data
StackTrace:
   at SharpCore.Data.SqlClientUtility.ExecuteNonQuery(String connectionStringName, CommandType commandType, String commandText, SqlParameter[] parameters) in G:\Projects\Personal\SharpCore\SharpCore.Data\SqlClientUtility.cs:line 152
   at BusinessLayer.TblUnitMaster.Insert(TblUnitMasterDTO_ tblUnitMaster) in C:\Users\Tejas\Desktop\DTCode\CS\Repositories\TblUnitMaster.cs:line 48
   at PointOfSale.Unit.btnSave_Click(Object sender, EventArgs e) in E:\Desktop Backup\MCA\Sem_6\PointOfSale\PointOfSale\PointOfSale\Unit.cs:line 34
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at ComponentFactory.Krypton.Toolkit.KryptonButton.OnClick(EventArgs e)
   at ComponentFactory.Krypton.Toolkit.KryptonButton.b(Object A_0, MouseEventArgs A_1)
   at ComponentFactory.Krypton.Toolkit.ButtonController.OnClick(MouseEventArgs e)
   at ComponentFactory.Krypton.Toolkit.ButtonController.MouseUp(Control c, Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewBase.MouseUp(Point pt, MouseButtons button)
   at ComponentFactory.Krypton.Toolkit.ViewManager.MouseUp(MouseEventArgs e, Point rawPt)
   at ComponentFactory.Krypton.Toolkit.VisualControlBase.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at ComponentFactory.Krypton.Toolkit.VisualControlBase.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at PointOfSale.Program.Main() in E:\Desktop Backup\MCA\Sem_6\PointOfSale\PointOfSale\PointOfSale\Program.cs:line 18
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
InnerException: