Skip to main content
Post Undeleted by prospector
added 106 characters in body
Source Link
prospector
  • 3.5k
  • 1
  • 25
  • 42

Just replace it.

string dbsourcedbSource = "data source=myserver\sqlexpress";source=myserver\\sqlexpress";
dbsource
int sLen = dbsourcedbSource.IndexOf("=") + 1;
string getString = dbSource.Substring(sLen, dbSource.Length - sLen);

dbSource = dbSource.Replace("myserver\sqlexpres"getString, "whatyouwantotoreplaceitwith"whatyouwantotoreplaceitwith");

Just replace it.

string dbsource = "data source=myserver\sqlexpress";
dbsource = dbsource.Replace("myserver\sqlexpres", "whatyouwantotoreplaceitwith);

Just replace it.

string dbSource = "data source=myserver\\sqlexpress";

int sLen = dbSource.IndexOf("=") + 1;
string getString = dbSource.Substring(sLen, dbSource.Length - sLen);

dbSource = dbSource.Replace(getString, "whatyouwantotoreplaceitwith");
Post Deleted by prospector
Source Link
prospector
  • 3.5k
  • 1
  • 25
  • 42

Just replace it.

string dbsource = "data source=myserver\sqlexpress";
dbsource = dbsource.Replace("myserver\sqlexpres", "whatyouwantotoreplaceitwith);