Hi Kevin,
Here is the code from the main form
private void button1_Click(object sender, System.EventArgs e)
{
frmDialog frmDiag = new frmDialog()
if(frmDiag.showdialog == DiaglogResult.OK)
{
frmDiag.Dispose();
}
}
Now here is the code of the dialog form
public frmDialog()
{
string strConn = "Password=ga;Persist Security Info=True;User ID=sa;Initial Catalog=Northwind;Data Source=MICHAEL";
string strSql = "Select * from mySampTable";
SqlConnection cn = new SqlConnection(strConn);
SqlDataAdapter da = new SqlDataAdapter(strSql,cn);
DataSet ds = new DataSet();
da.Fill(ds);
this.dataGrid2.DataSource = ds.Tables[0];
cn.Close();
cn.Dispose();
}
Music Rocks
www.musicreserve.blogspot.comSuccess is 1% Inspiration & 99% Perspiration
God Sometimes Delays His Help to Test Our Faith and Energize Our Prayers
Our Boat May Be Tossed While He Sleeps, But He Wakes Up Before it Sinks.