Dear Experts
I use following codes to retrieve data from table, but get error
Conversion from type 'DBNull' to type 'String' is not valid.
str = "Select * from gpass where vou_no= " & Val(Me.txtGat.Text) & " And Date = '" & Me.txtDat.Text & "'"
dt = GetTable(str)
If (dt.Rows.Count > 0) Then
DataGridView1.Rows.Clear()
For i = 0 To dt.Rows.Count - 1
Me.DataGridView1.Rows.Add()
Me.DataGridView1.Rows(i).Cells(1).Value = IIf(IsDBNull(dt.Rows(i)("tittle")), " ", Trim(dt.Rows(i)("tittle")))
Next
End If
End If
Tittle column of gpass is as
Column------datatype
Tittle--------char(100)
And data in column is as
Null
Null
Null
Please help