string strcon = "Initial Catalog=POS;User ID=sa;Password=103"; protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { string[] parts = strcon.Split(';'); string dataSource = ""; for (int i = 0; i < parts.Length; i++) { string part = parts[i].Trim(); if (part.StartsWith("Data Source=")) { dataSource = part.Replace("Data Source=", ""); break; } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)