-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfile.aspx.cs
More file actions
63 lines (49 loc) · 1.96 KB
/
Copy pathProfile.aspx.cs
File metadata and controls
63 lines (49 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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.Configuration;
using System.Data;
using System.Web.Security;
namespace QUtopiaProject
{
public partial class Profile : System.Web.UI.Page
{
SqlConnection SQLConn = new SqlConnection("Data Source=DESKTOP-1M38HSH; Integrated Security=True");
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString);
con.Open();
SqlDataReader dataReader;
UserIDLabel.Text = "User ID : " + Session["UserID"];
SqlCommand cmd1 = new SqlCommand("select First_Name, Middle_Name, Last_Name, Mobile, E_Mail from UserTable where User_ID = @UserID", con);
cmd1.Parameters.AddWithValue("@UserID", Session["UserID"]);
dataReader = cmd1.ExecuteReader();
while (dataReader.Read())
{
NameLabel.Text = dataReader.GetString(0) + " " + dataReader.GetString(1) + " " + dataReader.GetString(2);
PhoneLabel.Text = "" + dataReader.GetInt64(3);
EMailLabel.Text = dataReader.GetString(4);
}
}//Page_Load sonu
protected void QuestionsButton_Click(object sender, EventArgs e)
{
Response.Redirect("~/Questions.aspx");
}
protected void QuizzesButton_Click(object sender, EventArgs e)
{
Response.Redirect("~/Quizzes.aspx");
}
protected void TakeTheQuizButton_Click(object sender, EventArgs e)
{
Response.Redirect("~/QuizVerification.aspx");
}
protected void QuizzesTakenButton_Click(object sender, EventArgs e)
{
Response.Redirect("~/QuizzesTaken.aspx");
}
}
}