来个高手速度3急,在线等。膜拜大神来吧 private void button2_Click(object sender, EventArgs e) { try { SqlConnection con = dbu.getConnection(); //SqlCommand com = con.CreateCommand(); Productdiscount pd = new Productdiscount(); Serviceinformation si = new Serviceinformation(); if (MessageBox.Show("您确定要导出吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { ExportDate ep = new ExportDate(); //ep.dgvOutPutExcel(dataGridView1); string se = "select sI_serviceName,aD_activityDiscount from tb_activityDiscount ad,tb_serviceInformation si where ad.aD_activityDiscountId=si.sI_serviceInformationId";
DataSet ds = new DataSet(); SqlDataAdapter sda = new SqlDataAdapter(se, con); sda.Fill(ds); int i = ds.Tables[0].Rows.Count; MessageBox.Show("ss" + i); //si.dataGridView1.DataSource = ds.Tables[0]; //int i = ds.Tables[0].Rows.Count; //MessageBox.Show("ss"+i);