473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to Check


In my webform i have 2 textbox

controls and one button control.
in 1st textbox control i'll enter

email id when it lost its focus i've

tocheck whether the entered email id

exist in database or not, if exists

it has to dispay message that email

id already exist
and i want to set focus to that text box.

see the below code
Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged

Dim i As Byte

Dim cmd As New OleDbCommand

cmd.Connection = MyConn

cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"

i = cmd.ExecuteScalar()

If i <> 0 Then

Response.Write(txtEmail.Text & " already exist")

txtEmail.Text = ""

// how to set focus to this text box. //

End If

End Sub

Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged

Dim i As Byte

Dim cmd As New OleDbCommand

cmd.Connection = MyConn

cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"

i = cmd.ExecuteScalar()

If i <> 0 Then

Response.Write(txtEmail.Text & " already exist")

txtEmail.Text = ""

End If

End Sub

when am running my application am

getting that message after clicking

on submit button. but what i want is
Hi,
it has to check before clicking on

submit button.
I set postback property of text box to true.

thanx in advance
yoshitha

Nov 19 '05 #1
2 1730
Just setting the autopostback property of the textbox should actually work.
This results in a postback as soon as the value of the textbox is changed and
the textbox loses focus.

Kind regards,
Nikander & Margriet Bruggeman

"Yoshitha" wrote:

In my webform i have 2 textbox

controls and one button control.
in 1st textbox control i'll enter

email id when it lost its focus i've

tocheck whether the entered email id

exist in database or not, if exists

it has to dispay message that email

id already exist
and i want to set focus to that text box.

see the below code
Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged

Dim i As Byte

Dim cmd As New OleDbCommand

cmd.Connection = MyConn

cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"

i = cmd.ExecuteScalar()

If i <> 0 Then

Response.Write(txtEmail.Text & " already exist")

txtEmail.Text = ""

// how to set focus to this text box. //

End If

End Sub

Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged

Dim i As Byte

Dim cmd As New OleDbCommand

cmd.Connection = MyConn

cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"

i = cmd.ExecuteScalar()

If i <> 0 Then

Response.Write(txtEmail.Text & " already exist")

txtEmail.Text = ""

End If

End Sub

when am running my application am

getting that message after clicking

on submit button. but what i want is
Hi,
it has to check before clicking on

submit button.
I set postback property of text box to true.

thanx in advance
yoshitha

Nov 19 '05 #2
hi
i've one more problem

i've to enter email id in text box so when am entering the email id the
textchanged event is firing.
but when i enter first charcter in the text box , the email ids statrs with
that character are displaying in the text box, so when i select that email
id, it is displaying in that text box but it not firing the textchaged event
of text box and also if i obseve the length of this text box it is
displaying 0 .
why this is happening with my application.
can u tell me
thanx in advance
yoshitha
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Craig Bailey | last post by:
Someone please explain what alternate universe I fell into this afternoon when PHP started telling me that 2 doesn't equal 2. Not sure about you, but when I run this, it tells me 59001.31 doesn't...
2
by: Askari | last post by:
Hi, How do for do a "select()" on a CheckButton in a menu (make with add_checkbutton(....) )? I can modify title, state, etc but not the "check state". :-( Askari
2
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
7
by: Tony Johnson | last post by:
Can you make a check box very big? It seems like when you drag it bigger the little check is still the same size. Thank you, *** Sent via Developersdex http://www.developersdex.com ***...
2
by: Travis.Box | last post by:
I have an MS Access userform with 16 Check Boxes. Each of the checkboxes has a different option value, which coincides with the Check Box name (eg. cb01.OptionValue = 1). At the bottom of the...
1
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will...
2
by: Chris Davoli | last post by:
How do you enable a check box in the GridView. I selected Checkbox Field in the Columns of the GridView, and the check box shows up in the Grid view, but it is disabled. How do I enable it so I can...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
5
by: starke1120 | last post by:
Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id...
1
by: ghjk | last post by:
my php page has 7 check boxes. I stored checked values to database and retrive as binary values. This is the result array Array ( => 0 => 1 => 0 => 1 => 0 => 0 => 1 ) 1 means checked....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.