Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2004, 05:09 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 146
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aadz5
Default SQL Server does not exist or access denied.

Hi guys,

this is the error I get when I execute this code,

SqlConnection objConnection;
            string strSQL;
            SqlCommand objCommand;

            string strConnection = "server=(Local)\\NetSDK;uid=sa;pwd=password;databa se=Northwind";

            objConnection = new SqlConnection(strConnection);

            objConnection.Open();
            strSQL = "SELECT CustomerID, CustomerName FROM Customers WHERE Region = 'WA'";
            //strSQL = "SELECT * FROM CustomerID";
            objCommand = new SqlCommand(strSQL, objConnection);
            //objCommand.CommandType = CommandType.StoredProcedure;
            SqlDataReader objDR = objCommand.ExecuteReader();
            if(objDR.HasRows)
            {
            datagrid.DataSource = objDR;
            datagrid.DataBind();
            }
            else if(!objDR.HasRows)
            {
            Response.Write("oh no!");
            }

does anyone know why??

Adz - The World is not enough
__________________
Adz - Learning The J2EE Ways.
 
Old May 1st, 2004, 02:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Please do not submit new article if it already has a topic.
Tnx in advance.
I hope I could help u at http://p2p.wrox.com/topic.asp?TOPIC_ID=12959

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server does not exist or access denied happygv SQL Server 2000 0 April 9th, 2008 02:27 AM
SQL Server does not exist or access denied jennypretty Classic ASP Databases 3 May 18th, 2007 11:43 AM
SQL Server does not exist or access denied. jimbeam36 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 3rd, 2004 08:51 AM
SQL Server does not exist or access denied haidee_mccaffrey Classic ASP Databases 19 June 28th, 2004 09:38 PM
SQL Server does not exist or access denied. nitinmailbox All Other Wrox Books 1 June 25th, 2003 06:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.