The following code is failing me on line: _sqlconnection.Open()
Public Function GetTables() As DataSet
_sqlconnection = New SqlConnection(ConfigurationManager.ConnectionStrings(BlockConStr))
Dim ds As DataSet = New DataSet()
Dim cmd As SqlCommand = New SqlCommand()
cmd.CommandText = "GetBlockandFiles"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = _sqlconnection
If _sqlconnection.State = ConnectionState.Closed Then
Dim _sqladapter As SqlDataAdapter = New SqlDataAdapter(cmd)
Catch ex As Exception
MessageBox.Show("An Unhandled exception occured : " + ex.Message.ToString())
here is the function for BlockConStr:
Public Function BlockConStr()
'Return "Server=.;Database=BlocksCycle; User Id=sa;Pwd=123456;connection timeout = 1"
Return "Server=10.0.1.72\SQLEXPRESS;Database=BlocksCycle;User Id=BlocksCycle;Pwd=bl0ckCycle;connection timeout = 1"
I'm interested in getting exact code in order to overcome the following error:
An Unhandled exception occurred: The ConnectionString property has not been initialized. (please note error attachment)
This was originally working through app.config file and was told I need to avoid using that since the end result is a plugin.
Thank you in advanced.