How to get Database Name from Connection String using SqlConnectionStringBuilder

后端 未结 7 1763
太阳男子
太阳男子 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:36

    You can use InitialCatalog Property or builder["Database"] works as well. I tested it with different case and it still works.

提交回复
热议问题