try this hope this will help you
public DataTable fill(string query)
{
con.Open();
SqlDataAdapter adap = new SqlDataAdapter(query, con);
DataTable dt = new DataTable();
adap.Fill(dt); con.Close();
return (dt);
}
public DataTable Brand_Name(string group)
{
string query = "Select distinct Brand_Name from Brand_Master where Group_Name='"+group +"'";
DataTable dt = fill(query);
return dt;
}
protected void Group_Name_SelectedIndexChanged(object sender, EventArgs e)
{
string group = Group_Name.Text;
DataTable dt =Brand_Name(group);
Brand_Name.Items.Clear();
Brand_Name.Items.Add("--Select--");
for (int i = 0; i < dt.Rows.Count; i++)
{
Brand_Name.Items.Add(dt.Rows[i]["Brand_Name"].ToString());
}
}