Hi
Please Help me it's very urgent
private void bindtoddl()
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = ConfigurationManager.ConnectionStrings[""].ToString();
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("SELECT 'B'+Cast(branchname as varchar)branchname, (FirstName+MiddleName+' '+LastName +' ('+d.DesignationName+')') AS Name ,nb.branchid FROM EmployeePersonalDetails ep,dbo.EmployeeCompanyDetails ec, Designations d,NewBranches nb where ep.EmployeeId=ec.EmployeeId and ec.DesignationId=d.DesignationId and nb.BranchId=ec.BranchId and d.DesignationName like 'COUNSELOR (SENIOR)' union (select 'B'+Cast(branchname as varchar)branchname, branchname ,branchid from newbranches )order by branchid", conn);
//SqlDataAdapter da = new SqlDataAdapter("SELECT (FirstName+MiddleName+' '+LastName +' ('+d.DesignationName+')') AS Name ,nb.branchid,nb.branchname FROM EmployeePersonalDetails ep,dbo.EmployeeCompanyDetails ec, Designations d,NewBranches nb where ep.EmployeeId=ec.EmployeeId and ec.DesignationId=d.DesignationId and nb.BranchId=ec.BranchId and d.DesignationName like 'COUNSELOR (SENIOR)' union (select 'B'+Cast(branchname as varchar)branchname,branchid,branchname from newbranches )order by branchid", conn);
DataSet ds = new DataSet();
da.Fill(ds);
rdemployees.DataSource = ds;
rdemployees.DataTextField = "Name";
rdemployees.DataValueField = "branchname";
rdemployees.DataBind();
}
private void SetDropDownStyle()
{
foreach (var item in rdemployees.Items.Cast<ListItem>().Where(li => li.Value.StartsWith("B", StringComparison.OrdinalIgnoreCase)))
{
item.Attributes.CssStyle.Add("font-weight", "bold");
}
}
I am concatenating branchname ia m using dropdown style,but iam not getting .Please solve the query
vijaya
Vijayar, if this helps please login to Mark As Answer. | Alert Moderator