I know this can be done but I can't seem to find it.
I want to pass my login info to my crystal report like this example"
Ok, this works but I want to get the information from my web.config file.
I don't want to have to make a new section for the info, as I already have a connections settings for the database.
My question is what object can I use and how do I use it to feed it my connectionstring and return the separate Login, Password, Server etc information.
Something like this:
Can this be done? Is it worth doing?
I even tried using Split to break the connection string apart, but that was just silly.
Please help...
I want to pass my login info to my crystal report like this example"
Code:
Dim myDBConnectionInfo = New CrystalDecisions.Shared.ConnectionInfo()
With myDBConnectionInfo
.ServerName = "Your SeverName"
.DatabaseName = "Your Database Name"
.UserId = "User Name"
.Password = "Password"
End With
... more code...
Ok, this works but I want to get the information from my web.config file.
I don't want to have to make a new section for the info, as I already have a connections settings for the database.
Code:
MyConnection = New System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ItemMasterConnectionString").ConnectionString)
My question is what object can I use and how do I use it to feed it my connectionstring and return the separate Login, Password, Server etc information.
Something like this:
Code:
MyConnection = New System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ItemMasterConnectionString").ConnectionString)
SomeObject.ConnectionString = MyConnection.ConnectionString
With myDBConnectionInfo
.ServerName = SomeObject.ServerName
.DatabaseName = SomeObject.DatabaseName
Can this be done? Is it worth doing?
I even tried using Split to break the connection string apart, but that was just silly.
Please help...