PC Review


Reply
Thread Tools Rate Thread

Cant solve this error.

 
 
=?Utf-8?B?TWU=?=
Guest
Posts: n/a
 
      9th May 2004
Hi Folks

I keep recieving the following error message when i try to bind a combobox to the value that is in a textbox. the application crashes on the following line...

Me.CBoxTitle.SelectedItem = frmExistingCustomer.TBTitle.Tex

this is the error mesaage i recieve
An unhandled exception of type 'System.NullReferenceException' occurred in Caravan.ex
Additional information: Object reference not set to an instance of an object

any help is appreciated
 
Reply With Quote
 
 
 
 
CT
Guest
Posts: n/a
 
      9th May 2004
Can't really say exactly what is wrong, but judging from the error message,
an object hasn't yet been instantiated. Now, in which method are you trying
to do this? Perhaps you're trying to perform this assignment before the
CBoxTitle has been instantiated (such as in the Page_Init event procedure),
or perhaps the frmExistingCustomer isn't loaded?

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Me" <(E-Mail Removed)> wrote in message
news:5A69E742-0535-4CB4-823C-(E-Mail Removed)...
> Hi Folks,
>
> I keep recieving the following error message when i try to bind a combobox
> to the value that is in a textbox. the application crashes on the
> following line....
>
> Me.CBoxTitle.SelectedItem = frmExistingCustomer.TBTitle.Text
>
> this is the error mesaage i recieve:
> An unhandled exception of type 'System.NullReferenceException' occurred in
> Caravan.exe
> Additional information: Object reference not set to an instance of an
> object.
>
> any help is appreciated



 
Reply With Quote
 
=?Utf-8?B?TWU=?=
Guest
Posts: n/a
 
      9th May 2004
Hi

The error i now recieve is

Cant bind to property or coloumn Title on datacource. Parameter name: datamembe

this message appears when i click the OK button on Form2. The message does not end the application but my binding code does not run
Here is my binding code

Tr
cn.Open(

da.Fill(Guest.dsGuest, "ClientDet"

txtTitle.DataBindings.Clear(
txtForename.DataBindings.Clear(
txtSurname.DataBindings.Clear(
txtaddress.DataBindings.Clear(
txtPostcode.DataBindings.Clear(
txtorganisation.DataBindings.Clear(
txtPhoneNo.DataBindings.Clear(

'display the records in the control
Guest.dsGuest.Tables("ClientDet").Select(
Me.txtTitle.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "Title")
Me.txtForename.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "Forename")
Me.txtSurname.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "SurName")
Me.txtaddress.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "Address")
Me.txtPostcode.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "Postcode")
Me.txtorganisation.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "OrgName")
Me.txtPhoneNo.DataBindings.Add(New Binding("Text", Guest.dsGuest.Tables("ClientDet"), "PhoneNo")

'place the values from the controls into the global varible
TBTitle = txtTitl
TBPubFName = txtForenam
TBPubLName = txtSurnam
TBPubAddr = txtaddres
TBPubPCode = txtPostcod
TBPubPhoneNo = txtPhoneN
TBPubOrg = txtorganisatio
LabelExClientID = lblExClientI

Me.Close(

i declare the variables at the top of the form like so
Public Shared TBTitle As TextBo
Public Shared TBPubFName As TextBo
Public Shared TBPubLName As TextBo
Public Shared TBPubAddr As TextBo
Public Shared TBPubPCode As TextBo
Public Shared TBPubPhoneNo As TextBo
Public Shared TBPubOrg As TextBo

can anyone plz help
 
Reply With Quote
 
CT
Guest
Posts: n/a
 
      10th May 2004
I can't see anything wrong from quickly browsing your code. Which line
throws the exception? In addition, do you have the database schema?

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Me" <(E-Mail Removed)> wrote in message
news:B13DFB37-4E0A-46A6-A581-(E-Mail Removed)...
> Hi,
>
> The error i now recieve is:
>
> Cant bind to property or coloumn Title on datacource. Parameter name:

datamember
>
> this message appears when i click the OK button on Form2. The message

does not end the application but my binding code does not run.
> Here is my binding code:
>
> Try
> cn.Open()
>
> da.Fill(Guest.dsGuest, "ClientDet")
>
> txtTitle.DataBindings.Clear()
> txtForename.DataBindings.Clear()
> txtSurname.DataBindings.Clear()
> txtaddress.DataBindings.Clear()
> txtPostcode.DataBindings.Clear()
> txtorganisation.DataBindings.Clear()
> txtPhoneNo.DataBindings.Clear()
>
> 'display the records in the controls
> Guest.dsGuest.Tables("ClientDet").Select()
> Me.txtTitle.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "Title"))
> Me.txtForename.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "Forename"))
> Me.txtSurname.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "SurName"))
> Me.txtaddress.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "Address"))
> Me.txtPostcode.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "Postcode"))
> Me.txtorganisation.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "OrgName"))
> Me.txtPhoneNo.DataBindings.Add(New Binding("Text",

Guest.dsGuest.Tables("ClientDet"), "PhoneNo"))
>
> 'place the values from the controls into the global varibles
> TBTitle = txtTitle
> TBPubFName = txtForename
> TBPubLName = txtSurname
> TBPubAddr = txtaddress
> TBPubPCode = txtPostcode
> TBPubPhoneNo = txtPhoneNo
> TBPubOrg = txtorganisation
> LabelExClientID = lblExClientID
>
> Me.Close()
>
> i declare the variables at the top of the form like so:
> Public Shared TBTitle As TextBox
> Public Shared TBPubFName As TextBox
> Public Shared TBPubLName As TextBox
> Public Shared TBPubAddr As TextBox
> Public Shared TBPubPCode As TextBox
> Public Shared TBPubPhoneNo As TextBox
> Public Shared TBPubOrg As TextBox
>
>
> can anyone plz help



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i have a error 57E how do i solve that Kelly Microsoft Word Document Management 0 28th Feb 2009 03:45 PM
Why this error and how to solve it ?? =?Utf-8?B?QW5kcmV3?= Microsoft Excel Programming 2 8th Mar 2007 07:24 PM
How Can I solve this error =?Utf-8?B?UmFlZCBTYXdhbGhh?= Microsoft VC .NET 1 19th May 2005 09:22 PM
how to solve this error? tonywang Microsoft Windows 2000 Hardware 3 9th Apr 2004 01:37 PM
these URLs helped me solve my bridging problem...hope it can helps someone else and save the 3 days it took me to solve kenw Windows XP Networking 0 25th Jul 2003 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:22 PM.