|
-
December 10th, 2002, 05:52 AM
#1
Invalid Type
I'm very much new to VB.net arena
following function gives me trouble
Public Function GetBalHrs() As Double
Try
Dim objConn As New System.Data.SqlClient.SqlConnection(sConnection)
Dim objReader As System.Data.SqlClient.SqlDataReader
Dim strSql As String
'strSql = "Select Sum(Hrs) as hrs From Project Where [Update] = 0 "
strSql = "Select Programme From Project Where [Update] = 0 "
Dim objcmd As New System.Data.SqlClient.SqlCommand()
objConn.Open()
objcmd.CommandText = strSql
objcmd.Connection = objConn
objReader = objcmd.ExecuteReader()
objReader.Read()
' Dim a As String
Return objReader.GetFloat(0)
' Return a
Catch myException As System.Exception
MessageBox.Show(myException.Message)
End Try
End Function
Hrs field type is Float
it says invalidTypecast
How can I solve this
Thankx in advance
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
|