-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDriver Profile.aspx.cs
77 lines (53 loc) · 1.72 KB
/
Driver Profile.aspx.cs
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data.SqlClient;
using System.Data;
namespace RDA
{
public partial class Driver_Profile : System.Web.UI.Page
{
string strcon = ConfigurationManager.ConnectionStrings["rdacon"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
getdriverbyid();
}
//upddate account
protected void Button1_Click(object sender, EventArgs e)
{
}
//delete account
protected void Button2_Click(object sender, EventArgs e)
{
}
protected void Button3_Click(object sender, EventArgs e)
{
}
void getdriverbyid()
{
try
{
SqlConnection con = new SqlConnection(strcon);
if (con.State == ConnectionState.Closed)
{
con.Open();
}
SqlCommand cmd = new SqlCommand("SELECT * from driver_acc where userID='" + Session["username"].ToString() + "';", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (Exception ex)
{
Response.Write("<script>alert('Exception Occured " + ex + "');</script>");
}
}
}
}