Geeks With Blogs
David Williams Who's scruffy looking?
We need to access a Business Objects/Crystal Enterprise Server from our Web application, and are storing connection information in our webconfig file.  Rather than several different settings in Web.Config, I created a New Connection string property using standard the standard SQL Server connection string syntax, and used SQLConnectionStringBuild to parse the Crystal connection string.  When the username/password is first needed, Initialize is called, and the connection sting is pulled from the config file:
    Public Sub Initialize()
        Dim CeConnectionString As String
        CeConnectionString = ConfigurationManager.ConnectionStrings("CE").ConnectionString
        Dim connBuilder As New SqlConnectionStringBuilder(g_ceConnString)
        g_strDataSource = connBuilder.DataSource
        g_ceUsername = connBuilder.UserID
        g_cePassword = connBuilder.Password
    End Sub
Posted on Monday, January 29, 2007 2:11 PM | Back to top

Comments on this post: Using SqlConnectionStringBuilder to Parse a Connection String.

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © David Williams | Powered by: