示例#1
0
        private void Venta_Load(object sender, EventArgs e)
        {
            txtNombre.Text = "";
            textBox2.Text  = "";
            Conexion.Open();
            CD_Productos c = new CD_Productos();

            c.autocompletar(txtNombre);
            String cadena = "select * from usuarios";

            global  = new SqlCommand(cadena, Conexion);
            lectura = global.ExecuteReader();
            while (lectura.Read())
            {
                comboBox1.Items.Add(lectura.GetString(1));
            }
            string nombre = Program.nombre;

            comboBox1.SelectedIndex = 0;
            comboBox1.SelectedItem  = Program.nombre;
            button2.Enabled         = false;
            button3.Enabled         = false;
            Conexion.Close();
        }