Please Im getting the above error due to running code below from .aspx.vb form.
Ive taken out some code below to simplify this question.
Partial Class Process_Master
Inherits System.Web.UI.P age
Protected Sub lst_Employees_S electedIndexCha nged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles lst_Employees.S electedIndexCha nged
Dim strConn As String =
"server=company server;database =CompanyDB;Trus ted_Connection= yes"
Dim sql As String = "Select * from tbl_Master"
Dim conn As New SQLConnection(s trConn)
Dim objDR As SQLDataReader
Dim Cmd As New SQLCommand(sql, conn)
conn.Open()
objDR = Cmd.ExecuteRead er(System.Data. CommandBehavior .CloseConnectio n)
Page.DataBind()
End Sub
End Class
I know most likely its missing the namespace shown below but whereever I put
this namespace I error out. In an original webform the code above is within
..aspx instead of separated out and it works. Im now separating out these
events from .aspx and am running into this "SQL" error.
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SQLClie nt" %>
thanks for any assistance.
Ive taken out some code below to simplify this question.
Partial Class Process_Master
Inherits System.Web.UI.P age
Protected Sub lst_Employees_S electedIndexCha nged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles lst_Employees.S electedIndexCha nged
Dim strConn As String =
"server=company server;database =CompanyDB;Trus ted_Connection= yes"
Dim sql As String = "Select * from tbl_Master"
Dim conn As New SQLConnection(s trConn)
Dim objDR As SQLDataReader
Dim Cmd As New SQLCommand(sql, conn)
conn.Open()
objDR = Cmd.ExecuteRead er(System.Data. CommandBehavior .CloseConnectio n)
Page.DataBind()
End Sub
End Class
I know most likely its missing the namespace shown below but whereever I put
this namespace I error out. In an original webform the code above is within
..aspx instead of separated out and it works. Im now separating out these
events from .aspx and am running into this "SQL" error.
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SQLClie nt" %>
thanks for any assistance.
Comment