Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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 September 9th, 2008, 07:57 AM
Registered User
 
Join Date: Sep 2008
Location: Gloucester, MA, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataRowView Type Not Defined (CH 14)

When I try to complete the exercise for "Hooking into RowDataBound" in Chapter 14 (Beginning ASP.NET 3.5 - VB), I get an error that DataRowView is an undefined type. The intellisense doesn't list or recognize it either. Any ideas why? I am using VWD Express Edition.

        Select Case e.Row.RowType
            Case DataControlRowType.DataRow
                Dim myRowView As DataRowView = CType(e.Row.DataItem, DataRowView)
                If Not Convert.ToBoolean(myRowView("Authorized")) Then
                    e.Row.CssClass = "HighContrast"
End If
  #2 (permalink)  
Old September 9th, 2008, 12:51 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Looked like you missed step 3 on page 491 that instructs you to add an Imports statement for the System.Data namespace.

BTW, if you post book related questions, can you post them in the book's own forum located here: http://p2p.wrox.com/forum.asp?FORUM_ID=386 ? Makes it easier for me and others to keep track of things. I now almost overlooked this post.

And can you please specify a page number or ASPX file name so I know where to look instead of skimming through the whole chapter? ;)

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
  #3 (permalink)  
Old September 9th, 2008, 01:04 PM
Registered User
 
Join Date: Sep 2008
Location: Gloucester, MA, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much! BTW nice book! I am enjoying it very much.

Kaisha
  #4 (permalink)  
Old September 9th, 2008, 01:35 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

You're welcome... Glad you like the book.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
  #5 (permalink)  
Old April 23rd, 2009, 12:42 PM
Authorized User
 
Join Date: Dec 2008
Location: San Antonio, TX, USA.
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Exclamation Same problem, but using C#

Hello,

I had the exact same problem as Kaisha, except I was using the C# version. Step 3 says:

Quote:
At the top of Code Behind of the document add the following line of code if you are using Visual Basic .NET:

Code:
Imports System.Data
By trial and error, I discovered that my Code Behind required a similar addition:

Code:
using System.Data;
Only then would the "Try It Out" exercise work properly for me. If it means anything, I am using VWD 2008 Express Edition.

Was this step listed somewhere earlier in the book and I just missed it somehow? It was not stated on page 491.

Great book overall, by the way.

I'm mostly ASP Classic and a smidgen of PHP ~ completely clueless about .NET but trying to get past that in advance of a major conversion project at work.

Thanks,
Eddie McHam
__________________
~ Eddie McHam
  #6 (permalink)  
Old April 25th, 2009, 05:07 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Eddie,

It looks like the default "using" statements have changed between the release version of VWB 2008 and the first service pack. Initially, a new WebForm would contain this code in C#
Code:
 
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
Now, when I add a new web form, I get this:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
As you can see, among others the System.Data statement is missing. Therefore, you now indeed need to add it manually as you figured out already. I'll have it added to the errata section of the book.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 


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
ADODB.Connection user-defined type not defined Wall st Guru Excel VBA 2 March 26th, 2014 03:44 PM
ch.14 file errors caseyc BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 10 February 28th, 2006 03:59 PM
CH. 14 Stored Procedure mcauliff BOOK: Beginning ASP 3.0 1 October 4th, 2005 01:52 PM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
Ch. 14 Calendar Modification Astalder BOOK: Beginning ASP.NET 1.0 6 December 1st, 2004 06:23 PM



All times are GMT -4. The time now is 11:27 PM.


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