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
rashmi kc
NA
113
159.4k
Grid view in windows form c#
Jul 17 2012 2:30 PM
I am having a grid view when i double click on the row its value should display in the text box and combobox respectively but m getting error and its not displaying ...
Pls help me ...
Here s my code
private void dataGridView1_DoubleClick(object sender, EventArgs e)
{
try
{
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter("select class_standard,subjectcode,subjectname from tblsubject where subjectcode=" +
Convert.ToInt16(dataGridView1.SelectedRows[0].Cells[0].Value.ToString()) + " ", con);
da.Fill(dt);
//display now the record in the textbox
textboxsubcode.Text = dt.Rows[0][0].ToString();
textboxsubname.Text = dt.Rows[0][1].ToString();
cmboboxclass.Text = dt.Rows[0][2].ToString();
}
catch (Exception error)
{
MessageBox.Show(error.ToString());
}
}
Reply
Answers (
3
)
String parsing
How can I connect to remote database for my application