Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003
This is the forum to discuss the Wrox book Professional VB.NET 2003 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Jonathan Pinnock, Rama Ramachandran, Bill Sheldon; ISBN: 9780764559921
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 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
  #1 (permalink)  
Old January 25th, 2004, 05:01 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data grid sorting on page 707

I have that problem with example Data grid sorting on page 707. Basic always gives me error in line, where it is

»objDataAdapter.Fill(objDataSet, »Authors«)«
I have the same software as authors of this book: Windows server 2000 SP3, SQL 2000, and Visual studio .NET enterprise edition. I am surprised on this error because all other previous examples in chapters 16,17 work OK.

--------------------------------------------------------------------------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        objConnection = New SqlConnection("server=localhost;database=pubs;inte grated security=sspi")
        If Not (IsPostBack) Then
            BindGrid("Last name")
        End If
    End Sub

ERROR
Login failed for user 'DOMA-CELERON1G3\ASPNET'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'DOMA-CELERON1G3\ASPNET'.

--------------------------------------------------------------------------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
       If Not (IsPostBack) Then
            BindGrid("Last name")
objConnection = New SqlConnection("server=localhost;database=pubs;inte grated security=sspi")
        End If
    End Sub

ERROR
Fill: SelectCommand.Connection property has not been initialized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Fill: SelectCommand.Connection property has not been initialized.

thanks in advance, Matej


  #2 (permalink)  
Old January 25th, 2004, 07:52 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look here for updated connection strings: http://www.able-consulting.com/dotne...anagedProvider

Basically, you should use Data Source and Initial Catalog to indicate the Server and the Database.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old January 27th, 2004, 09:23 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That did not help. I gess I will have to step over of the rest of this chapter. Maybe one of my services is not working properly.

  #4 (permalink)  
Old January 27th, 2004, 09:37 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You have to make sure that the ASPNET account has sufficient rights to the database Pubs.

By default, your ASPX pages will run under the context of the ASPNET account. (For "classic ASP", this was the IUSR_MachineName account).
To add this account, add it to you Login list under Security in SQL Server first, then grant it access to the Pubs database.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #5 (permalink)  
Old January 28th, 2004, 02:26 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Amazing! Who would thought such a thing!!!

Adding this ASPNET account to the to my Login list under Security in SQL Server Enterprise Manager solved my problem.
I still use the same connection string:
"server=localhost;database=pubs;integrated security=sspi"
and I am still logged as:
administrator under windows server 2000.

Thanks a lot. As a beginner I would newer got to this idea. Matej:)


  #6 (permalink)  
Old October 6th, 2004, 11:51 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know this is quite a bit later than when you posted. I'm just beginning and I only have the Desktop Engine and I've been searching for a way to do what you are talking about. I keep getting a login failed message also. I don't know of any way to grant any permissions. Any help you can give me will be appreciated. I'm using xp pro, vb.net, and sql server 2000 desktop engine.
  #7 (permalink)  
Old December 2nd, 2005, 05:43 AM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to amarmano Send a message via Yahoo to amarmano
Default

Hi Imar,

I have the same problem but i use oracle 9i database, where do i add the ASPNET login in oracle database.

Regds,
Amarnath M.



Similar Threads
Thread Thread Starter Forum Replies Last Post
client side sorting and paging in data grid prankur ASP.NET 1.0 and 1.1 Basics 1 February 3rd, 2006 12:05 PM
client side sorting and paging in data grid prankur ASP.NET 1.0 and 1.1 Professional 1 February 3rd, 2006 12:00 PM
problem in auto page navigation of data grid in AS kranthipriya ASP.NET 1.x and 2.0 Application Design 1 February 23rd, 2005 08:01 PM
data grid in chapter 17, page 708 gcpeters BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 January 16th, 2004 01:48 AM
Sorting in Data Grid matt.fields ASP.NET 1.0 and 1.1 Basics 0 October 21st, 2003 12:39 PM





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