View Single Post
  #1 (permalink)  
Old January 30th, 2005, 09:04 AM
blur_ivy blur_ivy is offline
Registered User
 
Join Date: Dec 2004
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default help: check duplication when do update in datagrid

hi,

  i've a editable datagird which let the user update the table.
 when the user click the update button , it will check whether the data it enter in the name field is already in the database, if it already exits ten it will return false.. else true.

i've tried string checkCmd = "SELECT Count(*) FROM tblConstType WHERE constName = " + "'" + role + "'";

using this, but if the result is "1" , it means 2 things, one is its own record (ther user din modify the data in this(name) textbox) or there is another record in the database. so if it is its own record, i would like to let the datagrid continue updating the record.

i'd try b4 to get the initial value of the textbox in the datagrid EditCommand (but seems fail currently..) to allow update action happen when it is its own record.. so i wonder is there any way to perform this task? ( allowing update when it is its own record")

really hope to get some help here.. thanks...

Reply With Quote