Reputation: 11916
To log on to the SQL Server, I have to log on to the remote server (Windows 2003) and open the Management Studio and type the SQL Server address and Domain/Name, Password.
This is been setup for security purpose.
My Code come up with SQL connection error, as I am unable to access through my machine.
This is related to my Previous Question.
How do I solve this issue?
protected void Button1_Click(object sender, EventArgs e)
{
SqlDataReader dr = null;
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionStringOES"].ConnectionString);
con.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM <Table>", con);
dr = cmd.ExecuteReader();
while (dr.Read())
{
Response.Write(dr[0] + "<br/>");
}
}
Upvotes: 0
Views: 143
Reputation: 37533
This can't be accomplished since it's not a code problem. The restriction in your code will be the same restriction you experience in SQL Management Studio. The only resolution is to have the security restrictions relaxed (unlikely), run your solution on a remote machine (difficult because it disqualifies debugging), or maintain a copy of the database in a local SQLExpress store.
The capability usually comes packaged within the Visual Studio software. http://www.microsoft.com/express/Database/
Upvotes: 1