B
Brett Miller
Hi,
I have created a SQLServerCE database table with 22 fields, I have a
parameterised INSERT Query, that looks something like this
CDisplay.CommandText = "INSERT INTO CDisplay ( " &
_"Status,LstTiPNo,CC,LastVisitDate
,CUniq,Indics,CallKey,SeqNo,TelNo,TelExtn," &
_"NIndic,BPO,D1,LegalName,SBLKey,Comment,Contact1,StNo,DspAddr,Descr1,Descr2
,PrvComp1) " & _"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
The Parameters are setup like this...
CDisplay.Parameters.Add(New SqlCeParameter("Status", SqlDbType.Int))
CDisplay.Parameters(0).IsNullable = True
This is done for each field...
I read records from a BinaryStream, and populate the parameters with the
respective values, sometime I do not get values for every field before I
reach the next record.
When I call
CDisplay.ExecuteNonQuery()
I get a NullReferenceExeception from the topmost Parameter that I did'nt
have a value for...
Why is this happening???? isn't IsNullable enough???
Thanks 4 u're Help.
BM
I have created a SQLServerCE database table with 22 fields, I have a
parameterised INSERT Query, that looks something like this
CDisplay.CommandText = "INSERT INTO CDisplay ( " &
_"Status,LstTiPNo,CC,LastVisitDate
,CUniq,Indics,CallKey,SeqNo,TelNo,TelExtn," &
_"NIndic,BPO,D1,LegalName,SBLKey,Comment,Contact1,StNo,DspAddr,Descr1,Descr2
,PrvComp1) " & _"VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
The Parameters are setup like this...
CDisplay.Parameters.Add(New SqlCeParameter("Status", SqlDbType.Int))
CDisplay.Parameters(0).IsNullable = True
This is done for each field...
I read records from a BinaryStream, and populate the parameters with the
respective values, sometime I do not get values for every field before I
reach the next record.
When I call
CDisplay.ExecuteNonQuery()
I get a NullReferenceExeception from the topmost Parameter that I did'nt
have a value for...
Why is this happening???? isn't IsNullable enough???
Thanks 4 u're Help.
BM