G
Guest
Hello,
What is wong with the following code I am getting “ The ConnectionString
property has not been initializedâ€
Sub BindDataGrid()
Dim myConnection As New
SqlConnection(ConfigurationSettings.AppSettings("Persist Security
Info=False;Integrated Security=SSPI;database=myDB;server=MyServer;Connect
Timeout=30"))
Const strSQL As String = "mySP"
Dim myCommand As New SqlCommand(strSQL, myConnection)
myConnection.Open()
DataGrid1.DataSource =
myCommand.ExecuteReader(CommandBehavior.CloseConnection)
DataGrid1.DataBind()
End Sub
mySP is a stored procedure wihh is simple “select * from myTableâ€
Thanks,
Jim.
What is wong with the following code I am getting “ The ConnectionString
property has not been initializedâ€
Sub BindDataGrid()
Dim myConnection As New
SqlConnection(ConfigurationSettings.AppSettings("Persist Security
Info=False;Integrated Security=SSPI;database=myDB;server=MyServer;Connect
Timeout=30"))
Const strSQL As String = "mySP"
Dim myCommand As New SqlCommand(strSQL, myConnection)
myConnection.Open()
DataGrid1.DataSource =
myCommand.ExecuteReader(CommandBehavior.CloseConnection)
DataGrid1.DataBind()
End Sub
mySP is a stored procedure wihh is simple “select * from myTableâ€
Thanks,
Jim.