Is the error a reason? (SQL server does not exist or access is denied)

Source: Internet
Author: User

This problem occurs during project migration today,SQL Server does not exist or access is denied

This is a normal problem. Generally, there is a solution. Check 1433 --> check the connector --> patch SP3.
In general, it is normal to patch SQL Server SP3 in Windows 2003.
But today's situation is different. In order to simplify the problem, I took the shortest database connection code, which was generated by Microsoft ASP. NET web matrix.

// Insert page code here
//
System. Data. dataset myquerymethod (){
String connectionstring = "Server = \ '192. 168.191.5 \ '; user id = \ 'devuser \'; Password = \ devuserpw \ '; database = \ 'aioa \'";
System. Data. idbconnection dbconnection = new system. Data. sqlclient. sqlconnection (connectionstring );

String querystring = "select [aioa_tabs]. * from [aioa_tabs]";
System. Data. idbcommand dbcommand = new system. Data. sqlclient. sqlcommand ();
Dbcommand. commandtext = querystring;
Dbcommand. Connection = dbconnection;

System. Data. idbdataadapter dataadapter = new system. Data. sqlclient. sqldataadapter ();
Dataadapter. selectcommand = dbcommand;
System. Data. dataset = new system. Data. dataset ();
Dataadapter. Fill (Dataset );

Return dataset;
}

Let's take a look at the running situation in Microsoft ASP. NET web matrix.

Note: matrix comes with a Micro web server and does not require IIS to parse Asp.net.

Copy the same code to Vs and then run it.

The environment is different. Is there a problem with IIS? Afternoon of depressing problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.