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
Collins Aigbekhai
NA
171
504
Datagridview not able to retrieve record
Aug 24 2018 3:36 AM
I can not retireve record to row in datagridview, using cell_leave event and using the first cell as index to retrieve from database the code is as follows:
private void dgv_CellLeave(object sender, DataGridViewCellEventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=Me; Database=Services;Integrated Security=true");
string str = ("SELECT Code,Category,ItemColor,Price FROM Item WHERE Code='" +col0+ "'");
SqlCommand cmd = new SqlCommand(str, con);
con.Open();
DataTable table = new DataTable();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(table);
dgv.DataSource = table;
}
}
Please can someone help me?
the image
Reply
Answers (
6
)
Regarding Data Grid View Header
data validation not work in mvc.. please see my code.....