System.NullReferenceException: 'The object reference is not defined to an instance of an object.' ر vb.net

  • Thread starter Thread starter Houssem12
  • Start date Start date
H

Houssem12

Guest
hi members

i face this error System.NullReferenceException: 'The object reference is not defined to an instance of an object.'

i make sql select from database to a datatable

when i click for the first time it work in second time it return this error

Dim cmd2 As New SqlCommand("select Codearticle,Designation,Qte,PrixUnitaire,Remise,ReferenceFournisseur,NumeroEnsemble,Marge,numseq from DetailReceptionFrs where Numero='" & str1 & "' order by numseq", cn)
Dim da1 As SqlDataReader = (cmd2.ExecuteReader)
While da1.Read
dt5.Rows.Add("", da1(0), da1(1), da1(2), da1(3), da1(4), da1(5), da1(6), da1(7))
tabNum.Rows.Add(da1(8))
End While
help please

Continue reading...
 
Back
Top