Monday, March 19, 2012

Check db before move items from listbox1 to listbox2 or save them into db

I have two listboxes: listbox1 retrieve rows from tblProfileUsers and listbox2 receive users from listbox1 to save them into the same table tblProfileUsers, but users must have an unique profile associate to him.

So I need that my web form checks if selected users already are on tblProfileUsers and block operation before they saved with a 2nd or 3rd profiles.

I′m using VSTS with SQL 2005.

Check out the SQLExists function.

|||

hi

first you could useselect cout statement to find that user name on those table you want and read the int , if int was 0 it means that there is no such user in that table and you could add that.

for this you could use SqlCommand , SQL connecrtion and SqlDataReaderYes

No comments:

Post a Comment