Database Reference
In-Depth Information
txtSort.AppendText("Name\t\t\tCostRate\n");
txtSort.AppendText("__________________________________________\n");
// Display data
foreach (DataRow row in dtc[1].Rows)
{
txtSort.AppendText(row["Name"].ToString().PadRight(25));
txtSort.AppendText("\t");
txtSort.AppendText(row["CostRate"].ToString() );
txtSort.AppendText(Environment.NewLine);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + ex.StackTrace);
}
finally
{
// Connection close
conn.Close();
}
}
6. To set the FilterSort form as the start-up form, modify the Program.cs
statement.
Application.Run(new PopDataSet());
to appear as :
Application.Run(new FilterSort());
Build the project, and run it by pressing Ctrl+F5. Your results should look like
Figure 15-6.
 
Search WWH ::




Custom Search