-
My First Web Service
<%@ WebService Language="VB" Class="MyFirstClass" %>
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Services
Public Class MyFirstClass
<WebMethod()> Public Function GetDesc(CategoryID as String) As String
Dim Connection As SQLConnection = New SQLConnection("server=localhost;uid=sa;pwd=;database=NorthWind")
Dim strSQL as String = "select Description FROM Categories WHERE
CategoryID = Convert(Varchar,'" & CategoryID & "')"
Dim Command As SQLCommand = New SQLCommand(strSQL, Connection)
Dim DS As New DataSet
Command.FillDataSet(DS, "Reviews")
Dim Description as String
If DS.Tables("Reviews").Rows.Count > 0 Then
Description = DS.Tables("Reviews").Rows(0)("Review").ToString()
Else
Description = "no data"
End If
Return Description
End Function
End Class
What is Wrong with that code ??????
Thanx Guy.
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks