Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional VB 2005 ISBN: 0-7645-7536-8
This is the forum to discuss the Wrox book Professional VB 2005 by Bill Evjen, Billy Hollis, Rockford Lhotka, Tim McCarthy, Rama Ramachandran, Kent Sharkey, Bill Sheldon; ISBN: 9780764575365
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 31st, 2006, 12:34 PM
Registered User
Join Date: Mar 2006
Location: Oshawa, , Canada.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 Code Problems

I've downloaded the examples file (3/31/2006), I've also downloaded and installed Pubs.mdf.

The method GetAuthorSqlReader does not appear to exist, I can add it, however the errors won't allow me to build the project.

When I load the examples solution file there are 9 errors, as a result I can't Build the project. The 1st error is "Type 'SqlRecord' is not defined." This error is repeated several times along with others.

Have I set something up wrong in Visual Studio, or am I missing part of the code somehow?

OK I found some information on MSDN that says that the sqlRecord type
has been removed from vb 2005.

So what do I do to fix the following line of code:
Public Function ExecSpReturnRecord(ByVal spName As String, _
                                         ByVal paramValues As IDictionary) As SqlRecord

It looks like this code was written for and would work with the early beta version of VB 2005, but not with the release version.
  #2 (permalink)  
Old April 5th, 2006, 04:12 PM
Wrox Author
Join Date: Feb 2006
Location: San Diego, , USA.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

Wow, that's weird when I shipped the code for this chapter I had that part commented out. I will see if I can upload the code again for this chapter.

  #3 (permalink)  
Old April 7th, 2006, 01:14 PM
Registered User
Join Date: Mar 2006
Location: Oshawa, , Canada.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts


The code does not seem to have been updated and I wanted to use this method of retrieving data for a project I'm working on - a working example would really help.

I'm sure eventually someone will figure out how to update the on-line post, in the meantime can you e-mail the updated code to me?

  #4 (permalink)  
Old April 9th, 2006, 08:39 PM
Registered User
Join Date: Mar 2006
Location: Oshawa, , Canada.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for the code update, it got rid of all the compile errors. I still have a problem when I try to run the program - I get the following error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I am using SQLExpress which might be the problem, can you tell me how to fix this problem? I have installed the Pubs database and it shows in SQL Express as well as in Server Explorer.

I have the same problem with a database that I have created from scratch, I'm trying to use this connection concept in it as well.

I still can't get it to work useing the entry in app.config, I would like to be able to use a getConnection function with the connection string in the app.config file and I can't seem to get that to work.

I did get a connection using the following code (in my own app):
Dim dr As SqlClient.SqlDataReader
        Dim conn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Crisis1.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
        Dim command As SqlClient.SqlCommand = New _
            SqlClient.SqlCommand(storedProcedureName, conn)
        command.CommandType = CommandType.StoredProcedure
        dr = command.ExecuteReader(CommandBehavior.CloseConnect ion)
        While (dr.Read)
         (Read Stuff)
        End While

Can you tell me how to achieve this using your function/app.config concept? It's fine if it uses the code sample from the Pubs database - I can translate it to my database!


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 11 Code Examples ablinco BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 0 October 9th, 2006 03:56 AM
Where is source code for Chapter 11? benethridge BOOK: Professional Java Development with the Spring Framework 1 September 5th, 2006 08:58 PM
Chapter 11.....Ad Rotator problems ou812 BOOK: Beginning ASP 3.0 0 October 30th, 2003 11:29 AM

All times are GMT -4. The time now is 09:11 AM.

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