hi
i am trying display table value row by row in grid view.i want output this format
example:
i am got output this format, i want output first display description and column 1 value and next display another discription and value
0 1 2
Description COST OF CASTING COST OF ALUMINUM
CostOfaluminumpatternwithcorebox 6 2 2
Costofcasting000kgsCastIron 3 3
Costofmachiningandpainting 4 4
Overheadspackingforwardingand
transportation 5 5
Costofthecomponent 3 6
Totalcostofthecomponentfor000Nos 12 17
i want o/p this format
Description COST OF CASTING
CostOfaluminumpatternwithcorebox 6
Costofcasting000kgsCastIron 3
Costofmachiningandpainting 4
Overheadspackingforwardingand
transportation 5
Costofthecomponent 3
Totalcostofthecomponentfor000Nos 19
Description COST OF CASTING
CostOfaluminumpatternwithcorebox 6
Costofcasting000kgsCastIron 3
Costofmachiningandpainting 4
Overheadspackingforwardingand
transportation 5
Costofthecomponent 3
Totalcostofthecomponentfor000Nos 19
Description COST OF Aluminum
CostOfaluminumpatternwithcorebox 2
Costofcasting000kgsCastIron 2
Costofmachiningandpainting 2
Overheadspackingforwardingand
transportation 2
Costofthecomponent 2
Totalcostofthecomponentfor000Nos 10
please help me
public DataSet c()
{
DataSet ds = new DataSet();
string san = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
DataTable table = new DataTable();
using (SqlConnection conn = new SqlConnection(san))
{
string sql = "Select Chemicals,Min,Max from dbo.tbl_ChemicalMaster where Chemicalstd='" + dropchemical.SelectedItem.Text + "'";
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
using (SqlDataAdapter ad = new SqlDataAdapter(cmd))
{
ad.Fill(table);
}
}
}
ds.Tables.Add(table);
return ds;
}
public DataSet FlipDataSet(DataSet my_DataSet)
{
DataSet ds = new DataSet();
foreach (DataTable dt in my_DataSet.Tables)
{
DataTable table = new DataTable();
for (int i = 0; i <= dt.Rows.Count; i++)
{
table.Columns.Add(Convert.ToString(i));
}
DataRow r = null;
for (int k = 0; k < dt.Columns.Count; k++)
{
r = table.NewRow();
r[0] = dt.Columns[k].ToString();
for (int j =1; j <= dt.Rows.Count; j++)
r[j] = dt.Rows[j - 1][k];
table.Rows.Add(r);
}
ds.Tables.Add(table);
}
return ds;
}