Click here to Skip to main content
15,893,486 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I wish to do my system login by using web services.

May i know how to do it?

Please provide example source code for web services and how to call it in asp.net.

Thanks!!!!!

[Edit]
Moved here on OP's behalf from non-answer

I have tried it but have problem. i dun know what is the error occur. Hope have some one willing help me solve this problem.
This is my web method in web services.when i invoke this web method, i return the value 0 and show me the error message although i key in the correct username and password.

VB
Public Function Login(ByVal username As String, ByVal password As String) As String()
    Dim data(3) As String
    ' success = New String() {"3"}
    Dim validID As Integer

    Dim cmd As New SqlCommand

    DBStudent.Open()
    cmd.CommandText = "SELECT username,studentPass,studentEmel FROM student"
    cmd.Connection = DBStudent

    Dim myDataReader As SqlDataReader
    myDataReader = cmd.ExecuteReader

    While myDataReader.Read
        If username = myDataReader("username".ToString) And password = myDataReader("studentPass".ToString) Then
            data(0) = 1
            data(1) = myDataReader("username".ToString)
            data(2) = myDataReader("studentPass".ToString)
            data(3) = myDataReader("studentEmel".ToString)
            validID = 1
            Exit While
        Else
            data(0) = 0
        End If

    End While

    myDataReader.Close()
    cmd.Dispose()


    If validID <> 1 Then
        MsgBox(vbTab + vbTab + "Login fail." + vbCrLf + vbCrLf + "Invalid User", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "Status Login")

    End If
    DBSpin.Close()

    Return data


End Function


[/Edit]
Posted
Updated 17-May-11 7:07am
v3

1 solution

For starters, we all volunteer our time to help you here.
We don't really care either way how urgent your request is.
As well, just asking for source code is not how it works here. You need to show us what you have tried and when you have a problem ask a specific programming question regarding those issues. For what you are asking for, there is a wonderful tool called Google, you may have heard of it...
asp.net login using web service query returned about 30.5 million results. How about starting there.
 
Share this answer
 
Comments
Manfred Rudolf Bihy 17-May-11 13:08pm    
You tell him! 5+
Sergey Alexandrovich Kryukov 17-May-11 18:38pm    
Tell them, Marcus! My 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900