I use this simple code to get a Date and a Text from DateTimePicker and
TextBox as Multiline
into an ArrayList (utente.listaProblemasPassivos) and then show it in a
DataGridView (dgListaProblemasPassivos)

-----------------------------------------------------------------------------
Dim sData As String = LProb_DataPassivos.Value.ToShortDateString.toString
Dim sDesc As String = LProb_DescricaoPassivos.Text

utente.listaProblemasPassivos.Add(sData)
utente.listaProblemasPassivos.Add(sDesc)

dgListaProblemasPassivos.DataSource = Nothing
dgListaProblemasPassivos.DataSource = utente.listaProblemasPassivos
-----------------------------------------------------------------------------

And I alwys get this Error: "Object reference not set to an instance of an
object" in the first ADD line

I can't give a new instance to the utente.listaproblemaspassivos ArrayList
cause it's an ArrayList from my own Class and it could have values when it
gets here, and I can't erase them....

It's kind of a session variable, always the same (with add item and erase
item) until the user save the work.
--



Bruno Alexandre
(Sintra, PORTUGAL)

Re: a simple task... with errors by Bruno

Bruno
Tue Nov 15 10:04:45 CST 2005

don't you worry...

I already changed ArrayList into DataTable :)

--



Bruno Alexandre
(Sintra, PORTUGAL)



"Bruno Alexandre" <bruno.news@filtrarte.com> escreveu na mensagem
news:ebviBzc6FHA.1184@TK2MSFTNGP12.phx.gbl...
>I use this simple code to get a Date and a Text from DateTimePicker and
>TextBox as Multiline
> into an ArrayList (utente.listaProblemasPassivos) and then show it in a
> DataGridView (dgListaProblemasPassivos)
>
> -----------------------------------------------------------------------------
> Dim sData As String = LProb_DataPassivos.Value.ToShortDateString.toString
> Dim sDesc As String = LProb_DescricaoPassivos.Text
>
> utente.listaProblemasPassivos.Add(sData)
> utente.listaProblemasPassivos.Add(sDesc)
>
> dgListaProblemasPassivos.DataSource = Nothing
> dgListaProblemasPassivos.DataSource = utente.listaProblemasPassivos
> -----------------------------------------------------------------------------
>
> And I alwys get this Error: "Object reference not set to an instance of an
> object" in the first ADD line
>
> I can't give a new instance to the utente.listaproblemaspassivos ArrayList
> cause it's an ArrayList from my own Class and it could have values when it
> gets here, and I can't erase them....
>
> It's kind of a session variable, always the same (with add item and erase
> item) until the user save the work.
> --
>
>
>
> Bruno Alexandre
> (Sintra, PORTUGAL)
>
>
>
>