page_load
AddressBookSearch AddressSearch = new AddressBookSearch(); string mStr = AddressSearch.GetData(); Dt = AddressSearch.processAllDetails(mStr); try { if (Dt.Rows.Count > 0 && Dt != null) { TempDt.Columns.Add("Name"); TempDt.Columns.Add("NameUrl"); foreach (DataRow Dr in Dt.Rows) { DataRow TempDr = TempDt.NewRow(); if (string.IsNullOrEmpty(Dr["Title"].ToString().Trim() + Dr["First Name"].ToString().Trim() + Dr["Middle Name"].ToString().Trim() + Dr["Last Name"].ToString().Trim()) == true) { TempDr["Name"] = "(UnName)"; } else { TempDr["Name"] = Dr["Title"].ToString().Trim() + " " + Dr["First Name"].ToString().Trim() + " " + Dr["Middle Name"].ToString().Trim() + " " + Dr["Last Name"].ToString().Trim(); } TempDr["NameUrl"] = "Demo.aspx?Index=" + Dr["Index"].ToString(); TempDt.Rows.Add(TempDr); } DataView TempDv = new DataView(TempDt, "", "Name", DataViewRowState.CurrentRows); GridView1.DataSource = TempDt = TempDv.ToTable(); GridView1.DataBind(); } catch{}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)