The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Hi Fabrice,
I downloaded the complete source code from the Link you gave me.
I used my Visual C# 2008 Express to open the LingBooks.Common.csproj and I got the following 15 errors:
Error 1 The type or namespace name 'Publisher' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 11 11 LinqBooks.Common
Error 2 The type or namespace name 'Publisher' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 12 11 LinqBooks.Common
Error 3 The type or namespace name 'Publisher' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 13 11 LinqBooks.Common
Error 4 The type or namespace name 'Author' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 18 11 LinqBooks.Common
Error 5 The type or namespace name 'Author' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 19 11 LinqBooks.Common
Error 6 The type or namespace name 'Author' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 20 11 LinqBooks.Common
Error 7 The type or namespace name 'Author' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 21 11 LinqBooks.Common
Error 8 The type or namespace name 'Subject' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 26 11 LinqBooks.Common
Error 9 The type or namespace name 'Subject' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 27 11 LinqBooks.Common
Error 10 The type or namespace name 'Subject' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 28 11 LinqBooks.Common
Error 11 The type or namespace name 'Book' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 33 11 LinqBooks.Common
Error 12 The type or namespace name 'Book' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 43 11 LinqBooks.Common
Error 13 The type or namespace name 'Book' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 53 11 LinqBooks.Common
Error 14 The type or namespace name 'Book' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 63 11 LinqBooks.Common
Error 15 The type or namespace name 'Book' could not be found (are you missing a using directive or an assembly reference?) C:C#-LINQinActionSampleData.cs 73 11 LinqBooks.Common

I spent several hours to look into these errors and I have no ideas why I got them!!?? Could you please help and advise me how I can resolve these errors?

Thanks,
Scott Chang
Hi Fabrice, Thanks for sending me the files.

I am studying the files you just gave me, the Linqbooks.Common Project, the class library, SampleData.Books, etc....I feel I do not know how to reference the LinqBooks.Common (on Page 135) you mentioned in your Sept 4, 2009 post. Could you please give me more instructions on the "reference" thing?

Thanks again,
Scott Chang
Hi Fabrice,

The BusinessObjects folder I downloaded and saved in my C:// drive is empty - I think the computer system of my office does not allow the .zip files to pass through our computer system for the security reason. Could you please give me the non-zipped files "Book.cs", "Author.cs", "Review.cs", "Subject.cs", "Publisher.cs" and "User.cs" as well as the necessary "BusinessObjects" stuff associated the above-mentioned 6 files? My e-mail address is scott.h.chang@usace.army.mil.
Hi Fabrice, Thanks for your response.

I got it - I changed "books" to "book" after the where and before the .Length >10.
I ran it and it worked nicely as your book shows.

I want to go on to do the "Step 2: Using richer collections" to get the "Book" and "Price" result of Figure 4.12 Result of the second Windows Forms step. I read Pages 135-137 (for Windows Forms) and Pages129-132 (for aspx.cs) of your book and I still can not figure out how to add the LINQ code statements for the "Price" associated with the "Book"!!?? I feel ASP.NET is harder than Windows Forms and I have not tried to learn ASP.NET not all. Could you please help and enlighten me in doing this Step 2 (in Windows Forms)? Please respond.

Thanks again,
Scott Chang
Hi Fabrice,

I have struggled to get the LinqBooks.Common project installed in my Visual C# 2008 Express desperately. I feel that I need to create a Windows Form project for LinqBooks.Common from the scratch in my Visual C# 2008 Express myself - I should add the BusinessObjects that has Authors.cs, Book.cs, ClassDiagram1.cd, Publisher.cs, Review.cs, Subject.cs and User.cs. I saw the complete code statements of SampleData.cs from your downloaded files. But I do not know the contents/code statements of the BusinessObjects that has Authors.cs, Book.cs, ClassDiagram1.cd, Publisher.cs, Review.cs, Subject.cs and User.cs. Could you please give me the detailed instructions of writing these .cs and .cd files? By the way, what is ClassDiagram1.cd? I really want to pick up the skills of Windows Form-DataGridView (Book & Price) LINQ in C# Programming. Please kindly help me and respond ASAP. Many Thanks, Scott Chang
Hi,

I tried to execute Listing 4.13 in my Visual C# 2008 Express. I created a Windows Forms application, dropped a DataGridView control on the Form1 and typed the following code to Form1.cs:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace scWinFormLINQinAction4_13
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
String[] books = { "Funny Stories",
"All your your base are belong to us", "LINQ rules",
"C# on Rails", "Bonjour mon Amour"};

var query =
from book in books
where books.Length > 10
orderby book
select new { Book = book.ToUpper() };

dataGridView1.DataSource = query.ToList();
}
}
}



I executed this project. It ran and I got the result with output of "Book" in the first row of the DataGridView1 only and no output for the code statement "dataGridView1.DataSource = query.ToList();". I guess I missed to do somethings in the Properties of DataGridView1!!?? Please help and advise me what I missed in this project and how to correct the problem.

Thanks,
Scott Chang