I'm at a road block with this one.
I need to delete a row from a SQL 2k5 Express database.
All of my parameters are correct but the problem occurs when there might be a Null value or an Integer that needs to be deleted.
I have two public functions that sort which is which...
Public Function nTest(ByVal test as integer) as Integer
Return test
End Function
Public Function nTest(ByVal test as System.DBNull) as System.DBNull
Return Nothing
End Function
So that picks what type of value and works beautifuly for Null values but when I have an Integer, VS.Net says that I have an Invalid Cast Exception in my Delete Statement.
Me.tblTestTableAdapter.Delete(nTest(myVar))
Any ideas.
I need to delete a row from a SQL 2k5 Express database.
All of my parameters are correct but the problem occurs when there might be a Null value or an Integer that needs to be deleted.
I have two public functions that sort which is which...
Public Function nTest(ByVal test as integer) as Integer
Return test
End Function
Public Function nTest(ByVal test as System.DBNull) as System.DBNull
Return Nothing
End Function
So that picks what type of value and works beautifuly for Null values but when I have an Integer, VS.Net says that I have an Invalid Cast Exception in my Delete Statement.
Me.tblTestTableAdapter.Delete(nTest(myVar))
Any ideas.