示例#1
0
        public AddItem()
        {
            InitializeComponent();
            SQLiteCommand    cmmnd = new SQLiteCommand(@"Select * from Products;", Program.database_connection);
            SQLiteDataReader read  = cmmnd.ExecuteReader();

            while (read.Read())
            {
                this.dataGridView1.Rows.Add(read["id"].ToString(), read["name"].ToString(), read["price"].ToString(), read["stock"].ToString());
            }
            ProductID.Focus();
        }