hi friends,
i wants to display the related informations of each record of dataset. That mean, dataset having rows for A,B,C and etc..
Then i wants to display the information in same Gridview of each record(A,B,C). i wrote the below my coding, it dispaly info of the last row of dataset only. pls correct the coding.
protected void btnClick_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(strCS);
string strQury = "select [Group] from tblCust1 where CustID='"+ddlCustID.SelectedItem.ToString()+"'";
SqlDataAdapter da = new SqlDataAdapter(strQury, con);
DataSet ds = new DataSet();
da.Fill(ds);
foreach (DataRow row in ds.Tables[0].Rows)
{
strGroup = row["Group"].ToString();
BindGridview(strGroup,txtDate.Text);
}
}
public void BindGridview(string eachGroup,string strDate)
{
SqlConnection con = new SqlConnection(strCS);
string strQury = "select * from tblAuctionGroup where [Group]='" + eachGroup + "' and Date='" + strDate + "'";
SqlDataAdapter da = new SqlDataAdapter(strQury, con);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
}
}
Thanks
Thanks
tvn