S
Sparky Arbuckle
web.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- application specific settings -->
<appSettings>
<add key="myConnection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
source=Customers.mdb;" />
</appSettings>
<system.web>
<httpRuntime executionTimeout="5" maxRequestLength="8192"/>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
--------------------------------------------------------
DataGridEmail.aspx (Connection String)
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<SCRIPT runat="SERVER">
'Modified from Payne Listings 10.10 & 10.11
'declare connection object with page-level scope (use in two
subroutines)
Dim myConnection as NEW
OLEDBConnection(ConfigurationSettings.AppSettings("Customers"))
Sub Page_Load(obj as Object, e as EventArgs)
IF NOT Page.IsPostBack then subFillDataGrid()
END Sub
Sub subFillDataGrid(Optional EditIndex as integer=-1)
'If Datagrid is in edit mode then specify row to edit
IF NOT EditIndex.Equals(Nothing) then dgData.EditItemIndex = EditIndex
'Initialize command object
Dim objCommand as new OleDbCommand ("SELECT CustID, FirstName,
LastName, Email", myConnection)
TRY
myConnection.Open()
dgData.DataSource =
objCommand.ExecuteReader(CommandBehavior.CloseConnection)
dgData.DataBind()
CATCH objError as Exception
lblMessage.text += "<br />FillDataGrid "
lblMessage.text += "<br />Error message - " & objError.Message
lblMessage.text += "<br />Error source - " & objError.Source
END TRY
END Sub
--------------------------------------------
My error is as follows:
Error message - The ConnectionString property has not been initialized.
Error source - System.Data
Any help would be greatly appreciated!
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- application specific settings -->
<appSettings>
<add key="myConnection" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
source=Customers.mdb;" />
</appSettings>
<system.web>
<httpRuntime executionTimeout="5" maxRequestLength="8192"/>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
</configuration>
--------------------------------------------------------
DataGridEmail.aspx (Connection String)
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<SCRIPT runat="SERVER">
'Modified from Payne Listings 10.10 & 10.11
'declare connection object with page-level scope (use in two
subroutines)
Dim myConnection as NEW
OLEDBConnection(ConfigurationSettings.AppSettings("Customers"))
Sub Page_Load(obj as Object, e as EventArgs)
IF NOT Page.IsPostBack then subFillDataGrid()
END Sub
Sub subFillDataGrid(Optional EditIndex as integer=-1)
'If Datagrid is in edit mode then specify row to edit
IF NOT EditIndex.Equals(Nothing) then dgData.EditItemIndex = EditIndex
'Initialize command object
Dim objCommand as new OleDbCommand ("SELECT CustID, FirstName,
LastName, Email", myConnection)
TRY
myConnection.Open()
dgData.DataSource =
objCommand.ExecuteReader(CommandBehavior.CloseConnection)
dgData.DataBind()
CATCH objError as Exception
lblMessage.text += "<br />FillDataGrid "
lblMessage.text += "<br />Error message - " & objError.Message
lblMessage.text += "<br />Error source - " & objError.Source
END TRY
END Sub
--------------------------------------------
My error is as follows:
Error message - The ConnectionString property has not been initialized.
Error source - System.Data
Any help would be greatly appreciated!