SqlConnection, extract server & database values
-
I have an SqlConnection, what i need is to get the server value and the database value from the connectionstring it contains. Is there an easy way to get these values, or do I have to resort to using the dreadful regexp? :)
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);Morgonen är tröttmans mecka
-
I have an SqlConnection, what i need is to get the server value and the database value from the connectionstring it contains. Is there an easy way to get these values, or do I have to resort to using the dreadful regexp? :)
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);Morgonen är tröttmans mecka
Nvm, solved it ^^
SqlConnectionStringBuilder connstr = new SqlConnectionStringBuilder(ConnectionString);
string server = (string) connstr\["server"\]; string database = (string)connstr\["database"\];
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);Morgonen är tröttmans mecka