By using the IBM Database Add-Ins for Visual Studio, you can generate ADO.NET code and add the generated files to an ASP.NET Web Services project. The code is generated in the language of the project that the code is added to. The generated methods are marked as Web methods. You can build your project and deploy the Web methods as a Web service.
With Microsoft ASP.NET AJAX, you can call an ASP.NET Web service from the browser by using client script. If you use this feature, the code attribute ScriptService is added to each generated Web method. The following example in C# shows a generated Web service with the ScriptService attribute:
[ScriptService]
public class SimpleWebService : System.Web.Services.WebService
{
[WebMethod]
public string EchoInput(String input)
{
// Method code goes here.
}
}
Prerequisite: A Visual C# or Visual Basic ASP.NET Web Service Web site must be open before you can generate Web methods.
To generate Web methods:
The Generate Web Methods window opens.
Files that contain ADO.NET code for Web methods for the selected SQL statements are generated. You can build this project to deploy the Web service.
Using Visual Studio 2008 Technology in IBM Database Add-Ins for Visual Studio