using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Web.Configuration; using System.Text; public partial class admin_Profile : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["Login"]) == "") { Response.Redirect("../Login.aspx"); Response.End(); } ViewDataInf(); } protected void ViewDataInf() { SqlConnection objConn = null; string strConnString = null; StringBuilder strSQL = default(StringBuilder); SqlCommand objCmd = null; SqlDataAdapter dtAdapter = null; DataTable dt = null; DataSet ds = new DataSet(); strConnString = WebConfigurationManager.ConnectionStrings["edocConnectionString"].ConnectionString; objConn = new SqlConnection(strConnString); objConn.Open(); strSQL = new StringBuilder(); strSQL.Append("SELECT * "); strSQL.Append("FROM officer"); strSQL.Append("WHERE Username = @Username"); objCmd = new SqlCommand(strSQL.ToString(), objConn); objCmd.Parameters.Add("@Username", SqlDbType.VarChar).Value = Session["Login"]; dtAdapter = new SqlDataAdapter(); dtAdapter.SelectCommand = objCmd; dtAdapter.Fill(ds); dt = ds.Tables[0]; objConn.Close(); objConn = null; if (dt.Rows.Count > 0) { this.lblText.Text = dt.Rows[0]["EmpCode"].ToString(); } } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง