How to get Database Name from Connection String using SqlConnectionStringBuilder

后端 未结 7 1745
太阳男子
太阳男子 2020-12-02 21:52

I never want to split connection string using string manipulation and get server,database,uid and password.

I read the following link and read the accepted answer ,

相关标签:
7条回答
  • 2020-12-02 22:37

    See MSDN documentation for InitialCatalog Property:

    Gets or sets the name of the database associated with the connection...

    This property corresponds to the "Initial Catalog" and "database" keys within the connection string...

    0 讨论(0)
提交回复
热议问题