void control_gen() { scon = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=snetworking;Persist Security Info=True;User ID=aniket;Password=dakgator123;"); SqlDataReader rd; bool online; string StatusPic; SqlCommand scom = new SqlCommand("select ul.UName,ul.UStatus,gi.UserName from General_Information gi INNER JOIN ULogin ul ON gi.UName = ul.UName where(ul.UName in(select Receiver from FriendInvitation where Status='True' and Sender='" + Session["UserName"].ToString() + "') ) or (ul.UName in(select Sender from FriendInvitation where Status='True' and Receiver='" + Session["UserName"].ToString() + "') ) ", scon); scon.Open(); rd = scom.ExecuteReader(); while (rd.Read()) { if (rd["UStatus"].ToString() == "0") { StatusPic = "~/images/offLine.png"; online = false; } else { StatusPic = "~/images/onLine.png"; online = true; } GlobalMeth gm = new GlobalMeth(); Panel1.Controls.Add(filler(rd["UserName"].ToString(), rd["UName"].ToString(), gm.getImageURL(rd["UName"].ToString()), StatusPic, online)); } }
void control_gen() { scon = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=snetworking;Persist Security Info=True;User ID=aniket;Password=dakgator123;"); SqlDataReader rd; bool online; string StatusPic; SqlCommand scom = new SqlCommand("select ul.UName,ul.UStatus,gi.UserName from General_Information gi INNER JOIN ULogin ul ON gi.UName = ul.UName where(ul.UName in(select Receiver from FriendInvitation where Status='True' and Sender='" + Session["UserName"].ToString() + "') ) or (ul.UName in(select Sender from FriendInvitation where Status='True' and Receiver='" + Session["UserName"].ToString() + "') ) ", scon); scon.Open(); rd = scom.ExecuteReader(); while (rd.Read()) { if (rd["UStatus"].ToString() == "0") { StatusPic = "~/images/offLine.png"; online=false; } else { StatusPic = "~/images/onLine.png"; online=true; } GlobalMeth gm=new GlobalMeth(); Panel1.Controls.Add(filler(rd["UserName"].ToString(), rd["UName"].ToString(), gm.getImageURL(rd["UName"].ToString()), StatusPic, online)); } }
protected void Page_Load(object sender, EventArgs e) { GlobalMeth gObj = new GlobalMeth(); lblName.Text = gObj.getName(Session["UserName"].ToString()); }