/e_desk/viewproblem_user.aspx.vb
Visual Basic | 55 lines | 38 code | 13 blank | 4 comment | 0 complexity | a3de546f41543c293ecd32c21aea8b13 MD5 | raw file
1Imports System.Data
2Imports System.Data.SqlClient
3
4
5Namespace e_desk
6
7Partial Class viewproblem_user
8 Inherits System.Web.UI.Page
9
10#Region " Web Form Designer Generated Code "
11
12 'This call is required by the Web Form Designer.
13 <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
14
15 End Sub
16
17
18 Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
19 'CODEGEN: This method call is required by the Web Form Designer
20 'Do not modify it using the code editor.
21 InitializeComponent()
22 End Sub
23
24#End Region
25
26 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
27 'Put user code to initialize the page here
28 Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
29 con.Open()
30 If Not IsPostBack Then
31 Dim str As String
32 str = "select distinct(problemid) from problem_solution where userid='" + Session("username") + "' and status='Open' "
33 Dim cmd1 As SqlCommand = New SqlCommand(str, con)
34 Dim dr As SqlDataReader
35 dr = cmd1.ExecuteReader()
36 t5.DataSource = dr
37 t5.DataBind()
38 End If
39 End Sub
40
41 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
42 Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
43 con.Open()
44 Dim s1, str As String
45 s1 = t5.SelectedItem.Value
46 DataGrid1.Visible = True
47
48 str = "select m.problemid,m.problem,s.solution,s.solutionby from problem_solution s, problems_master m where m.problemid=" + s1 + " and s.problemid='" + s1 + "' and m.userid = '" + Session("username") + "'"
49 Dim cmd As New SqlCommand(str, con)
50 DataGrid1.DataSource = cmd.ExecuteReader
51 DataGrid1.DataBind()
52 End Sub
53End Class
54
55End Namespace