soran mohamad

soran mohamad

  • NA
  • 12
  • 4.9k

how to fill textbox with DGV column Content ?

Jun 3 2015 4:30 AM
hello 
how to fill textbox or richtextbox or combobox  with datagridview column content
 this is my code 
 
static public void refresh(DataGridView datagridview)
{
try
{
if (Connection.State == ConnectionState.Closed)
Connection.Open();
MySqlDataAdapter dataadapter = new MySqlDataAdapter("SELECT * FROM suTable", Connection);
DataTable dt = new DataTable();
dataadapter.Fill(dt);
datagridview.DataSource = dt;
}
catch (MySqlException Exception)
{
MessageBox.Show(Exception.ToString());
}
finally
{
Connection.Close();
}
 

Answers (1)