Here is my string line:
string conSTR = "Data Source=(local);Initial Catalog=MyDB;User ID=sa";
I just want to get the string "(local)", and "MyDb" and "sa" word anybody can suggest how to do it in C#.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming this is actually a SQL connection string, you could use
SqlConnectionStringBuilder– pass the string into the constructor, then interrogate the appropriate properties.