Please tell how to validate dataSource name and PortNumber in Connection String of SqlConnection. Connection state changes to Open, even I donot give any value for dataSource. Like the code below..
var Connection = new SqlConnection("Data Source=;Trusted_Connection=True");
try
{
Connection.Open();
MessageBox.Show("Connection Succeeded");
}
My requirement is I need to validate the Data Source name and Port Number that are entered by EndUser.