tags:

views:

69

answers:

2

Hi,

I have got a windows forms project. c# . For example there are 2 textbox in my form. In first textbox for Name and second is for surname.; Whenever user press over TAB button i wanna check from Database if there is a name like my first textbox's.text.If there is than it will get next control if it is not. then my program will ask for saving this name to DB with LINQ to Sql ?

Thanx for ur helps.

A: 

You want to attach to the Validating event on the Control.

leppie
A: 

On the ExitFocus event(not sure about the event name) of the first textbox do a select from the DB for the text in the textbox.

If your Count is 0 show a message box to the user prompting him to check whether he wants to save the username or else get the surname and populate it in the second textbox

Rony