In the Form1, i write the code for the button of the btn1Search_Click, but when i click
the button, the window still show the same data?????
//////////////////////
public partial class Form1 : Form
{
public static String str;
public Form1(String myStr)
{
InitializeComponent();
str = myStr;
}
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.DataSource = Infor.GetDataSet(str);
dataGridView1.DataMember = "elena";
}
private void save_Click(object sender, EventArgs e)
{
Infor.UpdateDataSet((DataSet)dataGridView1.DataSource);
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex >= 0)
{
if (dataGridView1.Columns[e.ColumnIndex].Name == "Column8")
{
dataGridView1.Rows.RemoveAt(e.RowIndex);
}
}
}
private void btn1Search_Click(object sender, EventArgs e)
{
this.Hide();
str = "select buyerName, id, category, productName, price, date, referenceNo from elena where referenceNo='d11'";
Form1 f1 = new Form1(str);
this.Show();
}
}