SqlDataAdapter dscmd2 = new SqlDataAdapter("SELECT * FROM DriveInfo; SELECT * FROM NetworkInfo", conn); dscmd2.TableMappings.Add("Table", "DriveInfo"); dscmd2.TableMappings.Add("Table1", "NetworkInfo"); DataSet ds2 = new DataSet(); dscmd2.Fill(ds2); for (i = 0; i <= ds2.Tables[0].Rows.Count - 1; i++) { for (j = 0; j <= ds2.Tables[0].Columns.Count - 1; j++) { //data = ds.Tables[0].Columns[j].ColumnName.ToString(); data = ds2.Tables[0].Rows[i].ItemArray[j].ToString(); //xlWorkSheet.Cells[i + 3, j + 1] = data; xlWorkSheet2.Cells[i + 3, j + 1] = data; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)