namespace Loginventory
{
public partial class Home : Form
{
public Home()
{
InitializeComponent(); display(); loadTitle();
}
public void display()
{
DataTable dt = bol.sp_display().Tables[0]; dataGridView1.DataSource = dt.DefaultView;
}
DataView dv; private void loadTitle()
{
string con = ConfigurationManager.ConnectionStrings["mar"].ConnectionString; try {
SqlDataAdapter ada = new SqlDataAdapter("select prodname, price, quantity, date_purchased, per_unit from tb_productinfo", con);
DataSet ds = new DataSet();
BindingSource bs = new BindingSource(); ada.Fill(ds, "prodname"); this.dataGridView1.AutoGenerateColumns = false;
DataTable dt = ds.Tables["prodname"]; bs.DataSource = ds.Tables["prodname"]; dv = new DataView(ds.Tables["prodname"]); this.dataGridView1.DataSource = bs;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void Home_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'buyerinfos.tb_buyer' table. You can move, or remove it, as needed. this.tb_buyerTableAdapter1.Fill(this.buyerinfos.tb_buyer); // TODO: This line of code loads data into the 'nalladineDataSet4.sp_displaybuyer' table. You can move, or remove it, as needed. this.sp_displaybuyerTableAdapter.Fill(this.nalladineDataSet4.sp_displaybuyer); // TODO: This line of code loads data into the 'nalladineDataSet3.tb_buyer' table. You can move, or remove it, as needed. this.tb_buyerTableAdapter.Fill(this.nalladineDataSet3.tb_buyer); // TODO: This line of code loads data into the 'nalladineDataSet1.sp_displayprod' table. You can move, or remove it, as needed. this.sp_displayprodTableAdapter.Fill(this.nalladineDataSet1.sp_displayprod); //// TODO: This line of code