Click here to Skip to main content
   

LINQ

 
QuestionLinq to SQL filter by logged in user in web forms Pinmemberfrazzle-me20-Dec-11 2:55 
AnswerRe: Linq to SQL filter by logged in user in web forms PinmemberWayne Gaylard20-Dec-11 20:18 
GeneralRe: Linq to SQL filter by logged in user in web forms Pinmemberfrazzle-me21-Dec-11 12:06 
QuestionRe: Linq to SQL filter by logged in user in web forms Pinmemberfrazzle-me10-Jan-12 4:30 
AnswerRe: Linq to SQL filter by logged in user in web forms PinmemberWayne Gaylard10-Jan-12 19:34 
QuestionDeclare TimeStamp in dbml Pinmembersiva4555-Dec-11 7:25 
QuestionExecute a LINQ query using T-SQL code in the LINQ expression Pinmemberjonatan_55628-Nov-11 2:06 
Questionlinq problem Pinmemberrama201123-Nov-11 20:37 
Hi all,

i want to bind datatable using linq query, can you please have a look on below mentioned query ,i am getting error.

public DataTable BindCustomername()
{
DataClasses1DataContext odeptdataclass = new DataClasses1DataContext();
DataTable odtname = new DataTable();
var name = from p in odeptdataclass.Tbldepts
select new
{
p.deptid,
p.deptname

};
odtname = name.ToString();
return odtname;

}

i am getting Error:Cannot implicitly convert type 'string' to 'System.Data.DataTable'

how to do that give me idea.

Thanks
Rama
AnswerRe: linq problem PinmemberWayne Gaylard23-Nov-11 20:55 
GeneralRe: linq problem [modified] Pinmemberrama201123-Nov-11 21:18 
GeneralRe: linq problem PinmemberWayne Gaylard23-Nov-11 21:27 
AnswerRe: linq problem Pinmemberemardini1-Dec-11 11:56 
AnswerRe: linq problem Pinmemberwazb10-Feb-12 1:21 
GeneralRe: linq problem PinmemberPeace ON23-Mar-12 19:01 
QuestionHow to know whether a string is a substring of list of strings. PinmemberNarVish1-Nov-11 2:59 
AnswerRe: How to know whether a string is a substring of list of strings. PinmemberWayne Gaylard1-Nov-11 4:14 
AnswerRe: How to know whether a string is a substring of list of strings. Pinmemberemardini5-Dec-11 17:58 
GeneralRe: How to know whether a string is a substring of list of strings. PinmemberBillWoodruff29-Jan-12 14:16 
AnswerRe: How to know whether a string is a substring of list of strings. PinmemberYospeh28-Jun-12 11:50 
QuestionC# datacontext with linq? Pinmemberdcof26-Oct-11 11:34 
QuestionIssue with Imultiple Results Pinmembersiva4551-Oct-11 19:07 
AnswerRe: Issue with Imultiple Results PinmemberCollin Jasnoch28-Oct-11 8:09 
QuestionCopytodatatable usage in VB Pinmemberahawth23-Sep-11 17:31 
AnswerRe: Copytodatatable usage in VB PinmemberMycroft Holmes14-Nov-11 14:21 
AnswerRe: Copytodatatable usage in VB Pinmemberprasun.r14-Dec-11 0:56 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 22 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid