Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2006, 04:44 PM
Authorized User
 
Join Date: Feb 2006
Location: Bluefields, , .
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MAKO
Default Unhandled NullReference Exception

Hello my People!!

I'm kinda having a hard time with an unhandled exception I don't seem to find. Check the block of code from where I get it:

private void idProductoComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            this.idProductoTextBox.Text = this.idProductoComboBox.SelectedValue.ToString();
        }


and this is the detail of the error message:


System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="RegistroRemisiones"
  StackTrace:
       at RegistroRemisiones.Remisiones.idProductoComboBox_S electedValueChanged(Object sender, EventArgs e) in C:\Mis documentos\Visual Studio 2005\Projects\RegistroRemisiones\RegistroRemisione s\Remisiones.cs:line 50
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.ListControl.OnSelectedValueCh anged(EventArgs e)
       at System.Windows.Forms.ComboBox.OnSelectedValueChang ed(EventArgs e)
       at System.Windows.Forms.ComboBox.OnSelectedIndexChang ed(EventArgs e)
       at System.Windows.Forms.ComboBox.set_SelectedIndex(In t32 value)
       at System.Windows.Forms.ComboBox.OnDataSourceChanged( EventArgs e)
       at System.Windows.Forms.ListControl.SetDataConnection (Object newDataSource, BindingMemberInfo newDisplayMember, Boolean force)
       at System.Windows.Forms.ListControl.DataSourceDispose d(Object sender, EventArgs e)
       at System.ComponentModel.Component.Dispose(Boolean disposing)
       at System.Windows.Forms.BindingSource.Dispose(Boolean disposing)
       at System.ComponentModel.Component.Dispose()
       at System.ComponentModel.Container.Dispose(Boolean disposing)
       at System.ComponentModel.Container.Dispose()
       at RegistroRemisiones.Remisiones.Dispose(Boolean disposing) in C:\Mis documentos\Visual Studio 2005\Projects\RegistroRemisiones\RegistroRemisione s\Remisiones.Designer.cs:line 18
       at System.ComponentModel.Component.Dispose()
       at System.Windows.Forms.Form.WmClose(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)
       at System.Windows.Forms.Form.DefWndProc(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
       at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
       at System.Windows.Forms.Form.WmSysCommand(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)
       at System.Windows.Forms.Form.DefWndProc(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
       at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
       at System.Windows.Forms.Form.WmNcButtonDown(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at RegistroRemisiones.Program.Main() in C:\Mis documentos\Visual Studio 2005\Projects\RegistroRemisiones\RegistroRemisione s\Program.cs:line 17
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAss embly()
       at System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext activationContext, String[] activationCustomData)
       at System.Runtime.Hosting.ApplicationActivator.Create Instance(ActivationContext activationContext)
       at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssemblyDebugInZone()
       at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
       at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()




this is stopping me from finishing a small test application I'm trying to develope. Help please!




MAKO - "El super simio"
__________________
MAKO - \"El super simio\"
 
Old April 19th, 2006, 05:46 AM
Authorized User
 
Join Date: Apr 2006
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dont know what is the problem exactly but maybe your combo SelectedValue is null?





Similar Threads
Thread Thread Starter Forum Replies Last Post
unhandled exception dipakp ASP.NET 2.0 Professional 1 July 6th, 2007 02:16 PM
Null reference exception was unhandled labby C# 2005 0 April 24th, 2007 06:14 AM
Unhandled NullReference Exception dheeraj1053 C# 1 May 30th, 2006 05:55 PM
Unhandled Exception stu9820 ASP.NET 1.0 and 1.1 Basics 11 January 14th, 2004 05:55 PM
Unhandled Exception: mbarrett C# 3 August 1st, 2003 05:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.