Hi,
How to use session variable here with If condition.. When i debug its not getting filled in dataset...Here actually according to USER_LEVEL i have to display records in repeater list.... My code is:
Thanks..Code:Private Sub ItemsGet() Try Dim strSQL As String ObjConn.Open() If Session("USER_LEVEL") = "II" Then Dim sda As New SqlDataAdapter("Select ..........where Responsible='" & Session("USER_ID") & "'",ObjConn) ElseIf Session("USER_LEVEL") = "III" Then Dim sda As New SqlDataAdapter("Select ...........where Type="MIS"",ObjConn) ElseIf Session("USER_LEVEL") = "IIII" Then Dim sda As New SqlDataAdapter("Select ............... where Type="IT"",ObjConn) Dim Items As New Dataset sda.Fill(Items) Dim ObjPds as New PagedDataSource ObjPds.DataSource = Items.Tables(0).DefaultView ObjPds.AllowPaging = True ObjPds.PageSize = 5 ObjPds.CurrentPageIndex=CurrentPage Customers.DataSource=ObjPds Customers.DataBind() EndIf ObjConn.Close() Catch ex As Exception End Try End Sub.
Yasin.


Reply With Quote


Bookmarks