|
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 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
|
|
|
September 9th, 2008, 07:57 AM
|
Registered User
|
|
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
September 9th, 2008, 12:51 PM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
September 9th, 2008, 01:04 PM
|
Registered User
|
|
Join Date: Sep 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you very much! BTW nice book! I am enjoying it very much.
Kaisha
|
April 23rd, 2009, 12:42 PM
|
Authorized User
|
|
Join Date: Dec 2008
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
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:
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
|
April 25th, 2009, 05:07 AM
|
|
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
|