private void button11_Click(object sender, EventArgs e)
{
//SERVER CONNECTION//
GLOBALDCC_Home globaldcchome = new GLOBALDCC_Home();
MySqlConnection connection = new MySqlConnection(myConnectionString);
//QUERY//
string sorgu = "select * " + "from dcc.db";
MySqlCommand database = new MySqlCommand(sorgu, connection);
MySqlDataAdapter da = new MySqlDataAdapter();
da.SelectCommand = database;
DataTable dbdataset = new DataTable();
da.Fill(dbdataset);
globaldcchome.dataGridView1.DataSource = dbdataset;
da.Dispose();
}
答案 0 :(得分:-1)
在Form2上添加一个公共方法:
public void AddDataToGrid(Object data)
{
// Add data to the grid
}