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
Build and run of Actuate reports
imap_mail_move on POP3 mailbox
Do you know a utility in Unix I could use that would compare 2 files (for ex:, files A.txt vs B.txt) and display the differences between the 2 files?
Non-Dell motherboard upgrade for Dell XPS Generation 5 Case
Windows XP slow to shut down or restart
problem killing a session in java
SAS 9.1 - Excel Import
Adobe InDesign CS4 Application Error
DCOM was unable to communicate with the computer "Name" using any of the configured protocols.
MAC Mail with Exchange 2007 Attachment Issue