What does this message mean?? Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.
here is my code
<%@ Page Language="VB" Debug="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ import Namespace="System.Data.sqlClient" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Drawing" %>
<%@ import Namespace="System.Web.HttpCookie" %>
<script runat="server">
Public Sub Page_Load(Source as Object, E As EventArgs)
if Not IsPostBack Then
BindData
End If
End Sub
Sub BindData
Dim dbconn As SqlConnection = New SqlConnection("server=AM1ST_FS1;database=HRINFO;uid=sa;"
Dim selectCMD As SqlCommand = New SqlCommand(" Select * From phonelist where location = 1st Floor Order by lastName"
dbconn.open()
fstfloor.DataSource = selectCMD.ExecuteReader()
fstfloor.DataBind()
dbconn.close()
End Sub
Exception Details: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.
here is my code
<%@ Page Language="VB" Debug="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ import Namespace="System.Data.sqlClient" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Drawing" %>
<%@ import Namespace="System.Web.HttpCookie" %>
<script runat="server">
Public Sub Page_Load(Source as Object, E As EventArgs)
if Not IsPostBack Then
BindData
End If
End Sub
Sub BindData
Dim dbconn As SqlConnection = New SqlConnection("server=AM1ST_FS1;database=HRINFO;uid=sa;"
Dim selectCMD As SqlCommand = New SqlCommand(" Select * From phonelist where location = 1st Floor Order by lastName"
dbconn.open()
fstfloor.DataSource = selectCMD.ExecuteReader()
fstfloor.DataBind()
dbconn.close()
End Sub