TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Demir Acar
NA
98
25.2k
Compare value of datagrid with value selected from database
May 24 2014 8:04 AM
Hi ;
I fill to grid with excel data and want to compare if value exists on database or not ?
for (int i = 0; i < dataGridView1.RowCount; i++)
if (radioButton1.Checked==true)
{
string strConn = @"Data Source='" + dbconfig.tb1 + "';Initial Catalog='" + dbconfig.tb2 + "';user='" + dbconfig.tb3 + "';pwd='" + dbconfig.tb4 + "'";
SqlConnection conn = new SqlConnection(strConn);
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT CODE FROM LG_" + dbconfig.tb5 + "_TABLE WHERE CODE NOT LIKE '" + dataGridView1.Rows[i].Cells[0].Value + "'", conn);
cmd.ExecuteNonQuery();
SqlDataReader reader = cmd.ExecuteReader();
if(reader.Read())
{
MessageBox.Show("Check ITEMS" + reader[i].ToString());
}
conn.Close();
}
Reply
Answers (
2
)
Baffled b/w Apache Cassandra and ASP.NET MVC 4
What is the usage of delegate in C#?