Microsoft
Software
Hardware
Network
Question : In .NET, how can I add to a variable value to a query result using LINQ to SQL?
I am using LINQ to obtain results for 3 values from a database used to populate a datagrid. I have a fourth value I'd like to add to the datagrid but it doesn't come from the database, its a value i set programmatically. Datagrid currently looks like:
TransID | ORI | TCN
------------|-----------|-
----------
--
xxxxx | yyyy | zzzz
But I want it to be like:
TransID | ORI | TCN | Availability
------------|-----------|-
----------
--|-------
----------
---
xxxxx | yyyy | zzzz | {string value}
Here's the code I use to get the database values, can someone help me complete it so I can add an arbitrary string to the list generated by the SQL Query? Thank you.
Dim db As New TransactionDataDataContext
Try
'Dim listTrans = (From trans In db.TransHeaderTables _
' Where trans.EncryptionORI = ORI _
' Select trans.TransId, trans.EncryptionTCN, trans.EncryptionORI).ToLis
t
Dim listTrans = db.ExecuteQuery(Of TransHeaderTable)( _
"Select dbo.XXX.TransId, dbo.XXX.EncryptionORI, dbo.XXX.EncryptionTCN FROM XXX.dbo.TransHeader" _
).ToList
Return listTrans
Catch ex As Exception
msg = "Failed to query the database for transaction list: " & ex.ToString
return nothing
End Try
Answer : In .NET, how can I add to a variable value to a query result using LINQ to SQL?
yes, the servers can be different builds, however, if you failover to the scr node with sp3 you do not want to failback until you have updated the original source
Random Solutions
Push not working on iphone with Exchange 2010...
How to hide a dummy date value.
3Com Switch Troubleshooting
Create Access Table Automically
truncate vs delete
Unable to connect Entourage 2004 to SBS 2008 Exchange mailbox
Best free viewer for .mov and avi files in Win XP
object required error
Where do I need to close/Dispose of my connections, in my code
What is the best cms to use with dreamweaver