private void factSalesman_Load(object sender, EventArgs e) { DataTable curDataTable; DatosAspel Data1 = new DatosAspel(); Data1.Connect(); String query = "select STATUS,CVE_VEND,CAN_TOT, IMP_TOT4,CONDICION,IMPORTE,FOLIO,CONTADO from FACTF01 where TRIM(CVE_VEND)='" + this.curSalesman + "'"; curDataTable = Data1.LoadData(query); this.dataGridView1.DataSource = curDataTable; this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; }
private void salesman_Load(object sender, EventArgs e) { //DataTable curDataTable; DatosAspel Data1 = new DatosAspel(); Data1.Connect(); this.curDataTable = Data1.LoadData("select NOMBRE,CVE_VEND from VEND01"); DataGridViewColumn col1 = new DataGridViewTextBoxColumn(); col1.HeaderText = "Nombre Completo"; col1.Name = "Nombre"; col1.Width = 220; this.dataGridView1.Columns.Insert(0, col1); DataGridViewColumn col2 = new DataGridViewTextBoxColumn(); col2.HeaderText = "Clave"; col2.Name = "Clave"; col2.Width = 20; col2.Visible = false; this.dataGridView1.Columns.Insert(1, col2); //this.dataGridView1.DataSource = curDataTable; this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; foreach (DataRow row in curDataTable.Rows) { String curName = row[0].ToString(); String curClave = row[1].ToString(); DataGridViewRow newrow = new DataGridViewRow(); newrow.CreateCells(this.dataGridView1); newrow.Cells[0].Value = curName; newrow.Cells[1].Value = curClave; this.dataGridView1.Rows.Add(newrow); } }
private void facturas_Load(object sender, EventArgs e) { DatosAspel Data1 = new DatosAspel(); Data1.Connect(); this.curDataTable = Data1.LoadData(""); DataGridViewColumn col1 = new DataGridViewTextBoxColumn(); col1.HeaderText = "Nombre Completo"; col1.Name = "Nombre"; col1.Width = 220; this.dataGridView1.Columns.Insert(0, col1); }