Click here to Skip to main content
16,015,072 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralWrapping Row Headers in Listview Pin
Member 20299148-Jun-05 6:51
Member 20299148-Jun-05 6:51 
QuestionHow to solve this? Thanks. Pin
shapper8-Jun-05 3:46
shapper8-Jun-05 3:46 
AnswerRe: How to solve this? Thanks. Pin
Dave Kreskowiak8-Jun-05 6:01
mveDave Kreskowiak8-Jun-05 6:01 
GeneralThread was being aborted Pin
macca248-Jun-05 3:30
macca248-Jun-05 3:30 
GeneralRe: Thread was being aborted Pin
Dave Kreskowiak8-Jun-05 6:00
mveDave Kreskowiak8-Jun-05 6:00 
GeneralCast from type 'DBNull' to type 'Integer' is not valid. Pin
msogun8-Jun-05 3:07
msogun8-Jun-05 3:07 
GeneralRe: Cast from type 'DBNull' to type 'Integer' is not valid. Pin
Dave Kreskowiak8-Jun-05 5:57
mveDave Kreskowiak8-Jun-05 5:57 
GeneralRe: Cast from type 'DBNull' to type 'Integer' is not valid. Pin
rwestgraham8-Jun-05 11:43
rwestgraham8-Jun-05 11:43 
You can use a Try Catch block to trap this exception, and as a matter of principle all database operations should have error handling because they can fail for numerous reasons.

However, a stored procedure returning a Null value is not always a true error, and it is best to test for this condition. You should test for the DBNull condition BEFORE you attempt to assign the return parameter value to an integer. This will allow you to trap the null before your code raises an invalid cast error.

Change your code to:

If IsDBNull(cmdAuthor.Parameters("@OrderID").Value) Then
eCount = -12345
Else
eCount = CInt(cmdAuthor.Parameters("@OrderID").Value)
End If


Robert
GeneralPlease help regarding NGen Pin
prashant79_pawar8-Jun-05 3:00
prashant79_pawar8-Jun-05 3:00 
GeneralRe: Please help regarding NGen Pin
Dave Kreskowiak8-Jun-05 5:52
mveDave Kreskowiak8-Jun-05 5:52 
GeneralRe: Please help regarding NGen Pin
Dave Kreskowiak9-Jun-05 2:50
mveDave Kreskowiak9-Jun-05 2:50 
GeneralUrgent - Cant Lock Application Pin
kakomalis8-Jun-05 2:32
kakomalis8-Jun-05 2:32 
GeneralRe: Urgent - Cant Lock Application Pin
Dave Kreskowiak8-Jun-05 5:50
mveDave Kreskowiak8-Jun-05 5:50 
GeneralMapi controls Pin
smita_roy8-Jun-05 2:29
smita_roy8-Jun-05 2:29 
GeneralRe: Mapi controls Pin
Dave Kreskowiak8-Jun-05 5:39
mveDave Kreskowiak8-Jun-05 5:39 
Generalsp with temptables doesnt work in crystal reports Pin
7-Jun-05 23:40
suss7-Jun-05 23:40 
Generalremoving temporary files after setup Pin
7-Jun-05 23:27
suss7-Jun-05 23:27 
GeneralRe: removing temporary files after setup Pin
rwestgraham8-Jun-05 1:49
rwestgraham8-Jun-05 1:49 
GeneralRe: removing temporary files after setup Pin
Rizwan Bashir8-Jun-05 2:05
Rizwan Bashir8-Jun-05 2:05 
GeneralRe: removing temporary files after setup Pin
rwestgraham8-Jun-05 2:35
rwestgraham8-Jun-05 2:35 
GeneralRe: removing temporary files after setup Pin
Brian Van Beek8-Jun-05 4:15
Brian Van Beek8-Jun-05 4:15 
GeneralRe: removing temporary files after setup Pin
Rizwan Bashir8-Jun-05 22:32
Rizwan Bashir8-Jun-05 22:32 
GeneralRe: removing temporary files after setup Pin
rwestgraham9-Jun-05 0:08
rwestgraham9-Jun-05 0:08 
GeneralRe: removing temporary files after setup Pin
Rizwan Bashir9-Jun-05 1:56
Rizwan Bashir9-Jun-05 1:56 
GeneralTile View Control VB.Net Pin
LesPal7-Jun-05 20:47
LesPal7-Jun-05 20:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.