We help IT Professionals succeed at work.
Get Started

how to compare dataGridView items with sql server table column in C#

delmandiyar
delmandiyar asked
on
883 Views
Last Modified: 2013-12-16
Hey Experts,
I have a dataGridView that contains one column that contains numbers, and it's possible to edit data, and i have a bottun that saves data.
Then i have a table in an sql server that have a column of numbers.
what i need is before i save (update) data from my dataGridView, i want to check if all numbers exists in the column that i have in my sql server table, if not, then show message else save.
how could i do that?

my dataGridView table witch only have one column is like this
col
---------
1
2
3

and my sql server table column is like this:
column
---------
1
2
4
7
3
8
6
9

Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE