-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDoctorViewProfile.aspx.cs
48 lines (44 loc) · 1.26 KB
/
DoctorViewProfile.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
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.Configuration;
public partial class DoctorViewProfile : System.Web.UI.Page
{
SqlConnection con;
SqlDataAdapter adp;
DataTable dt;
void bindview()
{
adp = new SqlDataAdapter("select * from dtable where did=@did", con);
adp.SelectCommand.Parameters.AddWithValue("did", Session["DID"].ToString());
dt = new DataTable();
adp.Fill(dt);
DetailsView1.DataSource = dt;
DetailsView1.DataBind();
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
Label1.Text = "";
Menu m3 = (Menu)Master.FindControl("Menu3");
m3.Visible = true;
con = new SqlConnection(ConfigurationManager.ConnectionStrings["connection"].ConnectionString);
con.Open();
if (!IsPostBack)
{
if (Session["DID"] != null)
bindview();
}
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
}