I need code to connect a remote server and displays the databases in that server either by windows authentication or sql server authentication.

>I need code to connect a remote server...

System.Data.SqlClient.SqlConnection cn;
cn=new System.Data.SqlClient.SqlConnection("put_connection_here");
//Test the server connection
cn.Open();
cn.Close();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.