G
Greg
Hi,
This code gives the error: "The ConnectionString property has not been
initialized" in the line : d.Fill(ds).
The sConnectionString is defined in web.config and refers to a sqlserver mdf
file.
Imports System.Data
Imports System.Data.SqlClient
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim d As SqlDataAdapter
Dim ds As DataSet
Dim sql As String
Dim sConnectionString As String
sConnectionString =
System.Configuration.ConfigurationManager.AppSettings("prod")
sql = "SELECT * FROM [mytable]"
d = New SqlDataAdapter(sql, sConnectionString)
ds = New DataSet()
d.Fill(ds)
Any idea what's wrong? I cant find my error.
Thanks
Greg
This code gives the error: "The ConnectionString property has not been
initialized" in the line : d.Fill(ds).
The sConnectionString is defined in web.config and refers to a sqlserver mdf
file.
Imports System.Data
Imports System.Data.SqlClient
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim d As SqlDataAdapter
Dim ds As DataSet
Dim sql As String
Dim sConnectionString As String
sConnectionString =
System.Configuration.ConfigurationManager.AppSettings("prod")
sql = "SELECT * FROM [mytable]"
d = New SqlDataAdapter(sql, sConnectionString)
ds = New DataSet()
d.Fill(ds)
Any idea what's wrong? I cant find my error.
Thanks
Greg