Server Error in '/webin' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'UsernameTableAdapter' is not defined.
Source Error:
Line 16:
Line 17: Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Line 18: Dim dataset As New UsernameTableAdapter
Line 19: Dim Recordset As Login.UsernameDataTable
Line 20:
ส่วนอันนี้เป็นโค๊ดไฟล์ของมันครับ
Imports LoginTableAdapters
Partial Class C_Display
Inherits System.Web.UI.Page
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Session("DateDo") = Calendar1.SelectedDate.Date
'AccessDataSource1.SelectParameters("DateDo").DefaultValue = Calendar1.SelectedDate.Date
GridView1.DataBind()
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
Session("TopicID") = GridView1.SelectedValue
Server.Transfer("C_Update.aspx")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim dataset As New UsernameTableAdapter
Dim Recordset As Login.UsernameDataTable
Recordset = dataset.GetData(TextBox3.Text, TextBox4.Text)
If Recordset.Count > 0 Then
For Each myrow As Login.UsernameRow In Recordset
Session.Add("UsrLEVEL", myrow.Authorize.ToString)
Next
Else
Session.Add("UsrLEVEL", "1")
End If
If (Session("UsrLEVEL") = "3") Or (Session("UsrLEVEL") = "2") Then
Button4.Visible = True
Else
Button4.Visible = False
End If
If (Session("UsrLEVEL") = "3") Then
Panel3.Visible = True
Else
Panel3.Visible = False
End If
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
Server.Transfer("C_Add.aspx")
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Server.Transfer("C_DisplayB.aspx")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Session("UsrLEVEL") = "3") Or (Session("UsrLEVEL") = "2") Then
Button4.Visible = True
End If
If (Session("UsrLEVEL") = "3") Then
Panel3.Visible = True
Else
Panel3.Visible = False
End If
End Sub
End Class