Hello all.
I was wondering if someone could give me an answer to what seems to be a simple question, however on a web search I cannot seem to find what I am looking for.
I wish to know if it is possible to stop duplicate records being entered into a two column UNBOUND datagridview class prior to it being sent to a database once all records have been entered into the datagridview. I am working in C#.
I realise I can set all sorts of keys on the MS SQL database which will receive it of course, however these keys would change dependant on the criteria set within the windows form. Sometimes the dataset will allow duplicate records, sometimes not.
Anyway, this is the simple layout. One datagridview, two text fields, submit, ok if record not duplicated, message box if record already exists in the datagridview. When all data is entered I will then submit the recordset to an ms sql database.
Can someone Help?
Loading
Raja KrishnamurthyPosted Mar 4, 2011, 7:38 AM
There is no out of the box feature in datagridview to do this. You would have to validate each row after it has been entered. After doing a quick search found this
HTH.
Happy Programming!!!
Cheers,
Raja
Chris JohnsonPosted Mar 8, 2011, 2:58 AM
Suthish NairPosted Mar 7, 2011, 2:22 PM
Chris JohnsonPosted Mar 4, 2011, 7:57 AM
All the best.