|
-
Dec 29th, 2003, 07:31 PM
#1
Thread Starter
Hyperactive Member
how to display the object datatype output into a text box.
how to convert the 'object' datatype into an integer and display it on the text box.
dim o as object
o = SqlHelper.ExecuteScalar(connection, "CountProductsByCategory", 1)
The variable 'o' has the correct output (single value) but how should I use CTYPE to convert it into the integer/string to display on the text box?
thanks
nath
-
Dec 29th, 2003, 07:52 PM
#2
Addicted Member
2 Methods
Dim myInteger As Integer
myInteger = CInt(o)
Or
myInteger = CType(o, Integer)
-
Dec 29th, 2003, 08:02 PM
#3
Fanatic Member
Integer.Parse(o) might also work.
-
Dec 29th, 2003, 10:30 PM
#4
Thread Starter
Hyperactive Member
-
Dec 29th, 2003, 11:15 PM
#5
Sleep mode
Or use the Convert static method :
VB Code:
Dim o As Object
Dim int As Integer = Convert.ToInt32(o)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|