a simple task... with errors

  • Thread starter Thread starter Bruno Alexandre
  • Start date Start date
B

Bruno Alexandre

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)
 
don't you worry...

I already changed ArrayList into DataTable :)

--



Bruno Alexandre
(Sintra, PORTUGAL)
 
Back
Top