Click here to Skip to main content
15,919,613 members
Home / Discussions / C#
   

C#

 
GeneralRe: dynamic variables inside While loop Pin
Christian Graus11-Mar-08 8:16
protectorChristian Graus11-Mar-08 8:16 
GeneralRe: dynamic variables inside While loop Pin
Member 278914211-Mar-08 8:29
Member 278914211-Mar-08 8:29 
QuestionRe: dynamic variables inside While loop Pin
Member 278914211-Mar-08 9:01
Member 278914211-Mar-08 9:01 
GeneralRe: dynamic variables inside While loop Pin
Christian Graus11-Mar-08 9:10
protectorChristian Graus11-Mar-08 9:10 
GeneralRe: dynamic variables inside While loop Pin
Member 278914211-Mar-08 9:12
Member 278914211-Mar-08 9:12 
AnswerRe: dynamic variables inside While loop Pin
buchstaben11-Mar-08 8:18
buchstaben11-Mar-08 8:18 
GeneralIndicate column sorting in DataGridView column Pin
AndrusM11-Mar-08 7:58
AndrusM11-Mar-08 7:58 
QuestionHelp on LINQ Pin
belzer11-Mar-08 7:50
belzer11-Mar-08 7:50 
Hello Forum

I am now getting familiar with LINQ and in need of some help,

I have I Products table with 20 columns but I want to query only 2 columns, the simple way of querying the data

List<Product> ItemList = (from items in dataContext.Products
select items).ToList();

The issue I have is with this example, I am getting back much more data that I really need which is creates extra network traffic etc.

How can I crate a list that will implement only 2 columns of the Product class and the LINQ statement will look something like this

List<Product> ItemList = (from items in dataContext.Products
select new { items.Item_Code, items.Item_Name }).ToList();
General[Cross Post] Re: Help on LINQ Pin
Scott Dorman11-Mar-08 8:03
professionalScott Dorman11-Mar-08 8:03 
GeneralRe: [Cross Post] Re: Help on LINQ Pin
belzer11-Mar-08 8:08
belzer11-Mar-08 8:08 
GeneralRe: [Cross Post] Re: Help on LINQ Pin
Scott Dorman11-Mar-08 8:24
professionalScott Dorman11-Mar-08 8:24 
GeneralRe: Help on LINQ Pin
Scott Dorman11-Mar-08 8:50
professionalScott Dorman11-Mar-08 8:50 
GeneralRe: Help on LINQ Pin
belzer11-Mar-08 9:17
belzer11-Mar-08 9:17 
GeneralRe: Help on LINQ Pin
Scott Dorman11-Mar-08 9:40
professionalScott Dorman11-Mar-08 9:40 
Questionconvert byte[] to short[] Pin
eyalbi00711-Mar-08 7:44
eyalbi00711-Mar-08 7:44 
GeneralRe: convert byte[] to short[] Pin
m@u11-Mar-08 7:54
m@u11-Mar-08 7:54 
GeneralRe: convert byte[] to short[] Pin
eyalbi00711-Mar-08 8:01
eyalbi00711-Mar-08 8:01 
GeneralRe: convert byte[] to short[] Pin
m@u11-Mar-08 8:08
m@u11-Mar-08 8:08 
GeneralRe: convert byte[] to short[] Pin
eyalbi00711-Mar-08 21:48
eyalbi00711-Mar-08 21:48 
GeneralRe: convert byte[] to short[] Pin
m@u11-Mar-08 22:52
m@u11-Mar-08 22:52 
GeneralC# ncurses Pin
marwooj11-Mar-08 7:36
marwooj11-Mar-08 7:36 
Questionbutton click event for more than 1 button Pin
steve_rm11-Mar-08 7:32
steve_rm11-Mar-08 7:32 
GeneralRe: button click event for more than 1 button Pin
m@u11-Mar-08 7:38
m@u11-Mar-08 7:38 
Generalwebbrowser and layout changing of current page Pin
eswes11-Mar-08 5:29
eswes11-Mar-08 5:29 
GeneralRe: webbrowser and layout changing of current page Pin
led mike11-Mar-08 5:49
led mike11-Mar-08 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.