sarika sarikaa

sarika sarikaa

  • NA
  • 60
  • 8.2k

give me solution in c#

Dec 27 2017 6:21 AM
for to add images in gridview column from mysql database.
 
private void Form2_Load(object sender, EventArgs e)
{
con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Admin\source\repos\DATABASE\data2.sql.mdf;Integrated Security=True;Connect Timeout=30");
con.Open();
adpt = new SqlDataAdapter("Select * from Details ", con);
dt = new DataTable();
adpt.Fill(dt);
dataGridView.DataSource = dt;
con.Close();
}
private void txtSearch_TextChanged(object sender, EventArgs e)
{
con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\Admin\source\repos\DATABASE\data2.sql.mdf;Integrated Security=True;Connect Timeout=30");
con.Open();
adpt = new SqlDataAdapter(" select * from Details Where [Part No] like '%"+txtSearch.Text+"%'",con);
dt = new DataTable("Details");
adpt.Fill(dt);
dataGridView.DataSource = dt;
con.Close();
txtSearch.Width = 300;
txtSearch.Height = 70;
txtSearch.Font = new Font("Bold", 15,FontStyle.Bold);
}
 

Answers (7)