Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 October 11th, 2004, 05:53 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well removed and reinstalled it all and now I get

Login failed for user 'MARINERHOME\ASPNET'.

heres my code. Do you see anything?
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.SqlClient" %>

<html>
  <head>
    <title>Beginning ASP.NET Databases Chapter 3</title>
  </head>

  <body>
    <h4>First Example: Listing data from the Employees table</h4>
    <asp:DataGrid id="dgNameList"
                  runat="server"
                  Gridlines="None"
                  BackColor="LightBlue"
                  CellPadding="5"
                  CellSpacing="5"
                  BorderWidth="2"
                  BorderColor="Black"
                  ToolTip="Includes only those employees who are at HQ" />
  <body>
</html>

<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
  Dim strConnection As String = "server=marinerhome; database=Northwind; " & _
                                "integrated security=true"
  Dim objConnection As New SqlConnection(strConnection)

  Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
                         "FROM Employees;"
  Dim objCommand As New SqlCommand(strSQL, objConnection)

  objConnection.Open()

  Response.Write("ServerVersion: " & objConnection.ServerVersion & _
                 vbCRLF & "Datasource: " & objConnection.DataSource & _
                 vbCRLF & "Database: " & objConnection.Database)

  dgNameList.DataSource = objCommand.ExecuteReader()
  dgNameList.DataBind()
  objConnection.Close()
End Sub
</script>

 
Old October 13th, 2004, 04:18 AM
Friend of Wrox
 
Join Date: May 2003
Location: Delhi, Delhi, India.
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Just Add the ASPNET as an username and select Northwind as a default database.

Enterprise Manager >> Your SQL Server Name >> Security >> Logins

Right Click on the Logins and select New Login, in New Login dialog box click on the button next to name text field.

All the available usernames will be now displayed, select ASPNET >> Click Add >> Click OK

Change the default database to Northwind in New Login dialog box and click ok to finish the process.

This complete process will add the ASPNET as a username in your database, try to run the ASPX page again.

Charul Shukla
 
Old October 13th, 2004, 06:54 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks I appreciate it and yes it works. I'm proud of my self because I figured it out prior to reading you very kind post.

I'm on my way to ASP.NET database land. Yaaaa!!!!!!!!!!!!!!



 
Old October 13th, 2004, 07:34 AM
Friend of Wrox
 
Join Date: May 2003
Location: Delhi, Delhi, India.
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nice to know that finally it works

Charul Shukla




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.