hello, i need some help here, i already bind my database coloumn 'NAMA' to my combobox 'cbNAMA', and now i want to show data from my database on textbox by selecting the row using cbNAMA but i got this error "System.InvalidCastExeception: Conversion from type 'DBNULL' to type 'String' is not valid" when i choose the coloumn that contain null value, i try to handle by using this code Dim int As Integer Dim command As SqlClient.SqlCommand Dim adapter As New SqlClient.SqlDataAdapter Dim dts As New DataSet Dim i As Integer Dim sql As String lblNDP.Text = int elseIf cbsem.Text = …

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a database with lots of fields, some of which are still empty and are to be filled in at a later stage. Is there any way of writing an IF statement (or any other method) that will allow these empty records to be 'shown' in my textboxes in Visual Studio, without receiving the error: [CODE]Conversion from type 'DBNull' to type 'String' is not valid.[/CODE]? Thanks in advance. Collin

Member Avatar
Member Avatar
+0 forum 6

The End.