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
Shovan Saha
NA
321
92.6k
Select from data grid view
May 5 2017 5:03 AM
This is in visual studio 2015, C# and MS Access database. I want to select from datagrid view not from database. How? Please code or example.
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
con = new OleDbConnection(conString);
string sql = "SELECT * FROM LalData WHERE SuspenceAccount like '" + comboBox1.Text + "%'";
con.Open();
adapter = new OleDbDataAdapter(sql, con);
dt = new DataTable();
adapter.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
btnSubmit.Enabled = false;
con.Close();
}
Reply
Answers (
3
)
cONVERSION FAILED WEN CONVWERTING VARCHAR VALUE HELLO IN TO
Is encryption without key ?