Oracle WebService

jeremypivonka

New member
Joined
Apr 11, 2005
Messages
1
Programming Experience
1-3
Okay, I'm trying to create a webservice in VS.Net for a class project. The code I have for one of the services is shown below. I have tried just about everything I can think of to make this thing work. Everytime I try to run it, it always returns a value of zero and it should be returning a value of 5. If anyone can help me I would greatly appreciate it. Thanks in advance.

------------------------------------------------------

<WebMethod(Description:="This service gets a total of the records for severity.")> Public Function GETALL() As Integer
Dim cs As String
cs = "Data Source=Oracle9i;User=user;Password=password;"
Dim objcn As OracleConnection = New OracleConnection(cs)
Try
objcn.Open()
Dim mysql As OracleCommand = objcn.CreateCommand()
mysql.CommandText = "select count(*) as TOTAL from severity;"
Dim objdr As OracleDataReader = mysql.ExecuteReader
While (objdr.Read())
GETALL = objdr("TOTAL").ToString()
End While
objdr.Close()
objcn.Close()
Catch myException As Exception
'Error Message
End Try
Return GETALL
End Function
 
Top Bottom