Chris Johnson

Chris Johnson

  • NA
  • 67
  • 32.1k

Using Key Fields in an UNBOUND Datagridview class.

Mar 4 2011 6:30 AM
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?

Answers (4)