Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try
- {
- string sql = "select emp_firstName,emp_surName,posit_name from Employee e inner join Position p on e.posit_id = p.posit_id where emp_username = '" + user + "' and emp_password = '" + pass + "'";
- SqlDataAdapter da = new SqlDataAdapter(sql, conn);
- DataTable dt = new DataTable();
- da.Fill(dt);
- conn.Close();
- if (dt.Rows.Count > 0)
- {
- result += dt.Rows[0]["emp_firstName"].ToString();
- result += " "+dt.Rows[0]["emp_surName"].ToString();
- //result += " : ";
- result += " "+dt.Rows[0]["posit_name"].ToString();
- }
- else
- {
- result = "-0";
- }
- }
- catch (Exception e)
- {
- MessageBox.Show("ไม่สามารถค้นหาข้อมูลห้องได้ : " + e.ToString(), "ขัดข้อง!!");
- }
- return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement