|
Replies:
0
-
Pages:
1
|
|
|
Posts:
28
From:
La Crosse, WI
Registered:
4/22/08
|
|
|
|
Want a pass thru query example
Posted:
Dec 9, 2008 9:29 PM
|
|
I want to write a generalized pass-thru query where the SQL statement is passed to the LINQ function from the caller. What should the Dim query As .... be to make this work? Code below: Public Shared Function ExecuteSQL(ByVal strModuleConnectionString As String, _ ByVal strSQL As String) As DataTable Dim dt As New DataTable Try Dim dc As New dcModuleDataContext(strModuleConnectionString) Dim query As System.Linq.IOrderedQueryable query = dc.ExecuteQuery(strSQL) dt = query.CopyToDataTable Catch exc As Exception Call WinExcept.ExceptionHandler.Exception(clinqModule, exc) dt = Nothing Finally End Try Return dt End Function
|
|
|
Legend
|
|
Gold: 300
+
pts
|
|
Silver: 100
- 299
pts
|
|
Bronze: 25
- 99
pts
|
|
Manning Author
|
|
Manning Staff
|
|