login form for web services vb.net

Hi,

I'm trying to create a windows form with  web services that check if the user and password are the same within the SQL SERVER DATABASE, if its the same then your a valid user if not your an invalid user. That is working ok, but I want to implement a try statement which only allows the user to enter in the details 3 times then the windows form shuts down. also if they do have it correct then another window opens up. ANY HELP PLEASE OR IF SOME 1 KNOWS HOW TO DO IT IN  ASP.NET :>

 HERE THE CODE:

<WebMethod()> _
        Public Function CheckUserDetails(ByVal UserName As String, ByVal Password As String) As String

        Dim strConnBuild As New SqlConnectionStringBuilder
        Dim strsql As String

        With strConnBuild
            .DataSource = "BUSDEV"
            .InitialCatalog = "StudentTrig"
            .UserID = "vbasic"
            .Password = "vbasic"
        End With

        strsql = "SELECT * FROM UserDetails WHERE UserName = '" & UserName & "' AND " & "Password = '" & Password & "'"
        Dim cmd As SqlCommand
        Dim rdr As SqlDataReader

        Using conn As New SqlConnection(strConnBuild.ConnectionString)
            Try
                conn.Open()

                cmd = New SqlCommand(strsql, conn)
              

                rdr = cmd.ExecuteReader()

                If rdr.HasRows Then
                    rdr.Read()
                    Dim user As String = rdr.Item(0)
                    Dim userpassword As String = rdr.Item(1)
                    If user = UserName And Password = userpassword Then
                        Return "Valid User"
                    End If

                Else
                    Return "Invalid User"

                End If
                conn.Close()

            Catch ex As Exception

        End Using

        Return "Invalid User"
        Else Trys < 2 'Not 3rd try yet
                    Try catch + = 1
            MsgBox("Incorrect details")
            elseif 'Third try so kick them out
            Dim i As Integer = MsgBox("incorrect details, please try again later")
        End Try
    End Function

 

 

THANKS

0
aspwebster
1/29/2009 3:41:36 PM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

1 Replies
804 Views

Similar Articles

[PageSpeed] 0

You should implement the retry logic on the client. The service cannot display a message box on the client, and could not shut down the windows form.

Besides, web services are better off if they have no state. So it's best if the service doesn't know how many times the login attempt has failed.


John Saunders | MVP – Connected System Developer
0
johnwsaunders3
1/29/2009 6:11:50 PM
Reply:

Similar Artilces:

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

.Net Web Form & Web Service Deployment
Hi all I have written some test web services and some web form applications and deployed them to my IIS. That's fine but I now want to deploy them to my real IIS server. I have created an msi for each but the problem is I seem to only be able to deploy to the default web site. Our default web site is turned off and instead we use several other sites. Does anybody happen to if Powerbuilder 11 supports non default web sites? If not do I need to hack the msi and if so can anybody suggest a suitable tool. I have Orca but it's not very friendly. Unless of course I knew exactly w...

Can you return .net web controls in a .net page from a web service?
I've got a problem with a project. I've got to compile an entire .net page and return it as part of a Web Service for display. The problem I have is that I need to add WebControls and functionality to the page so that not only the html content and images are displayed (which I've managed) but that textboxes, labels, buttons and datasets can be displayed also. Essentially I need to make a call from one site for a page, populate the page and return it in a state as though it resided on the same server/webspace as the calling page. Code is currently built as follows into a string: strOpenHT...

REVIEW: Real World XML Web Services for VB and VB.NET Developers
Real World XML Web Services: For VB and VB .NET Developers by Yasser Shohoud Addison-Wesley Pub Co Web Services. I can't believe there is anyone left alive in the technology sector that hasn't heard these two words. Everywhere you look there are articles, books, and web sites that talk about this technology. Do a book search for "Web Services" on amazon.com and you will be quite amazed how many Web Services books there are. With so many available picking one buy may seem overwhelming. The good news is it just got a little easier to do. Real World ...

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

Best Practice for .Net Web Service access to a Web Service on a Test and Production Servers
Hello All, What is the best way to control a .Net web service to be able to access a remote server for testing and then point to another remote server to access the web service in production? Do I need to generate and maintain 2 different proxy objects? TIA, Bob Bob // first create the proxy if not isvalid( i_service) then i_service = create fundtraderproxy_TradeServicesClient_BasicHttpBinding_ITradeServices end if ///You'll see code something like this in the constructor of your proxy //dynamically set the endpoint url with the user supplied value - //r...

XML Web service , Web form
hi i hope if u could help me in what i am making so i have a web form that does the collection of the information from the user when he hits the button this data must be sent to the xml web service but this service must deliver this data in xml then i read the information and insert it to the sql serevr Database could you help me becouse iam soo confused about where to start and what is the stuff to search in it iam new in the xml stuff help me pleaseeeeee“To be incredible you must produce great work”Visit My Bloghttp://www.dotnetjunkies.com/WebLog/hussein My first question is why are yo...

Troubleshoot Web Service; Ajax AutoComplete events do not appear to not fire; Ajax web service appears to not work. .NET
Folks, I had the situation that Ajax AutoComplete events in the web service did not fire after I copied a project out of a folder, renamed it and moved it to a server. The fix was hard to find but easy to solve. I had some web service modules in an ASMX file that provided AutoComplete entries -- i.e., after the user keys in 2 or 3 characters, the list of possible entries with those leading characters is displayed for the user to select. To solve the problem, look at the web service's directive, not the code-behind or the ASMX designer.  Do a right-mouse-click...

.NET Web Service and Non .NET programe
When we develop a web service by VB.NET. Then i use visual basic, Microsoft access, asp. Can these stuff access to my web service ? Means you want to access Webserver developed in VB.NET in ASP application?Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti...

Manipulating Microsoft DNS service from web service or web form.
Hiya All,   I need to be able to update an "A record" on Microsoft DNS Service for a particular domain from a web form or web service - and have no idea where to begin. I can run the form/service on the same box running DNS service... I am looking to make a IP address updater that will update my "home" ip address if it changes (similar to what DYNDNS offers, except I have my own name servers, so that wont work for me lol). Any kick in the right direction is greatly appreciated!   Dave...

.NET Web Service Proxy (EasySoap vs .NET)
Greetings all, I was provided with a URL for a web service that is password protected. I saved the WSDL file from the browser and am attempting to create a .NET Web Service Proxy to use it. When I select EasySoap for the 'Web Service Selection', I see one service ('Services') and five 'Structures' (which is the number of 'methods' that I am expecting to see). But when I select .NET, I still see one service (named differently) and only one structure. Four of the structures are missing. Is there something else I need to do to view the four ...

.NET CLIENT TO ACCESS a non. NET WEB SERVICE
I develop in .net and need to create a web client to connect to a web service built in Java. http://xchainj.com:8080/axis/services/ScsEnvirodatWaterQualityIndexServiceSoap Its pretty easy when the web service was also built in .net. You can just create a web reference with the gui and automatically can see its functions and stuff. when i put this url in the box and hit go i dont get to see its functions. maybe this shouldnt be the url of the WSDL?? I Have no idea. Im very new to all of this. If there are any examples of .net clients connecting to non .net web clients it woul...

Web resources about - login form for web services vb.net - asp.net.xml-web-services

United States Department of Health and Human Services - Wikipedia, the free encyclopedia
The United States Department of Health and Human Services ( HHS ) is a Cabinet department of the United States government with the goal of protecting ...

The Beatles arrive on Apple Music, other streaming services
... Beatles’ catalog has arrived on Apple Music on this Christmas Eve. The Fab Four’s music is also playing on other major music streaming services, ...

In the end the Beatles finally come to streaming services
It's been a long and winding road to get the Beatles on your devices and streaming services, but you've finally reached your destination and ...

The Beatles arrive on 9 different streaming music services
... December 24th in every time zone around the world, a huge portion of The Beatles' catalog will be available to stream on nine different services. ...

New online service seeks to shake up Seattle's office leasing market
... tools, such as a new one called Crelow. The Minneapolis-based startup, which launched in Seattle Wednesday, bills itself as matchmaking service ...

The Beatles discography will be on streaming services as of Christmas Eve
... any music fan can get excited about. As of 12:01 AM local time on Christmas Eve, The Beatles' entire discography will be on streaming services ...

How video streaming services are changing the future of TV
... created, distributed, and monetized. This shift has been brought on by the rising popularity of over-the-top content and video streaming services. ...

Favorite apps and services of 2015
Save time and money with our Windows editor's favorites: Android Pay, Google Fi, PlayStation Vue, and Windows 10.

College Financial Service Provider Higher One To Pay $28M In Fines, Refunds For Misleading Students
Higher One, Inc. promises to help students reach their goal of achieving a degree by providing money management and refund services. But federal ...

The Beatles Hit Music Streaming Services at Midnight Tonight
Announced this morning, The Beatles are finally, finally hitting music streaming services across the globe, and yes, this includes Google Play ...

Resources last updated: 12/24/2015 4:53:45 PM