Answers

Thank you for you reply my friend! would you please take a look to my problem that explained below?

I created a Solution with 4 layers (project) in VB.net. In first layer i created some dbml file for accessing SQL tables. in Second layer, named "DataAccessLayer" i prepared some functions that they contain LINQ method and returning required data from first
layer. For Example:

If we use this
link as a point of reference for LINQ to SQL the following code will take a LINQ statement result as a DataTable. The underlying source is a SQL-Server database for NorthWind which is a sample database from Microsoft.

For this to work you will need to place the following language extension into a code module, not a class or form.

<System.Diagnostics.DebuggerStepThrough()> _
<System.Runtime.CompilerServices.Extension()> _
Public Function ToDataTable(Of T)(ByVal value As IEnumerable(Of T)) As DataTable
Dim returnTable As New DataTable
Dim firstRecord = value.First
For Each pi In firstRecord.GetType.GetProperties
returnTable.Columns.Add(pi.Name, pi.GetValue(firstRecord, Nothing).GetType)
Next
For Each result In value
Dim nr = returnTable.NewRow
For Each pi In result.GetType.GetProperties
nr(pi.Name) = pi.GetValue(result, Nothing)
Next
returnTable.Rows.Add(nr)
Next
Return returnTable
End Function

I have also put an example together for you and I have the (rather simple) code shown on a
page of my site here. The data is from a datatable which contains U.S. Zip Codes and looks like this:

As you see in the code, I have simply the word "Stop" which acts the same as putting a breakpoint in. If you want - and I would encourage you to - download the project folder which is
zipped up and uploaded here.

It contains the whole thing, database and all, and that way you can run it and when it stops, hover your mouse over each of the LINQ declarations to see just what it returned.

Thank you for you reply my friend! would you please take a look to my problem that explained below?

I created a Solution with 4 layers (project) in VB.net. In first layer i created some dbml file for accessing SQL tables. in Second layer, named "DataAccessLayer" i prepared some functions that they contain LINQ method and returning required data from first
layer. For Example:

Thank you for you reply my friend! would you please take a look to my problem that explained below?

I created a Solution with 4 layers (project) in VB.net. In first layer i created some dbml file for accessing SQL tables. in Second layer, named "DataAccessLayer" i prepared some functions that they contain LINQ method and returning required data from first
layer. For Example: