Results 1 to 1 of 1

Thread: code for update button?

  1. #1
    surendarj is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    May 2010
    Posts
    2
    Reputation
    0

    code for update button?

    i have one registration form which consists of username, password, confirmpassword and Register button.
    When i will be typing the username, it should show whether the username is available or not. and i have changed the username column as primary key in sql database.

    Private Sub txtusername1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtusername1.KeyUp
    Dim da As New SqlDataAdapter("select * from Register", con)
    da.Fill(ds, "Register1")
    If txtusername1.Text = ds.Tables("Register1").Rows(0)(0).ToString Then
    lblusernameerror.Text = "Username is not available,choose another"
    Else
    lblusernameerror.Text = "Username is available"
    End If
    End Sub

    here i have written key up event in the text box of username, but here it is loading only one username...
    please give the correct coding and help me

    and also coding for primary key exception using exceptional handling.

    so i need the coding for that requirement...

    and also how to clear the text from the form...

    I am using visual basic 2008 and i am writing the program in disconected architecture in vb.net
    thanks in advance..
    please help me soon
    Last edited by JohnH; 05-27-2010 at 12:20 PM. Reason: removed email, use forum or IM/PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking