help: check duplication when do update in datagrid
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...