Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. First Web Service

First Web Service

Scheduled Pinned Locked Moved ASP.NET
wcfcsharpdatabasehelpasp-net
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Learner520
    wrote on last edited by
    #1

    Hi Everybody, I am using web services first time. Only for my understanding I have used very simple functionality: Addition of two numbers and population of a dropdown list. My questions are 1- when I used "Namespace" It raised an error that 'error BC30002: Type 'First Web Service' is not defined.' later I commented out namespace it is working fine. any tip how to sortout this error. 2- Basically I play all the time with database (binding and manipulating data with controls )and desperate to use WCF and web services. Is this any better/helpful to use in the same way I have use in the FirstWebService. why I am asking this because I can perform the same functionality using simple classes. I dont see any difference or I am confusing myself. any help will be appreciated. FirstWebService code: Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports Microsoft.VisualBasic Imports System.Data Imports System.Data.SqlClient Imports App_Code.DB Imports App_Code.Web 'Namespace App_Code.Web ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. '<System.Web.Script.Services.ScriptService()> _ <WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class FirstWebService Inherits System.Web.Services.WebService Dim dbeng As DBEngine Dim lEBStruct As EBStruct Public Sub New() dbeng = New DBEngine dbeng.YourDBName = ConnectionSource.DBName.PupilVoice End Sub Private _YGid As Integer Private _YGDesc As String Public Property YGId() As Integer Get Return _YGid End Get Set(ByVal value As Integer) _YGid = value End Set End Property Public Property YGDesc() As String Get Return _YGDesc End Get Set(ByVal value As String) _YGDesc = value End Set End Property <WebMethod()> _ Public Function HelloWorld() As String Return "Hello Mathematician" End Function <WebMethod()> _ Public Function AddTwoIntegers(ByVal dig1 As Integer, ByVal dig2 As Integer) As String Return Convert.ToString("<br/>you entered teri tou two digits: " & dig1 & " and " & dig2 & ". Sum of two digits is " & dig1 + d

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups