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
Windows XP Validate after 30 days expiry
Where can I find corflags.exe?
Browser Hijack
Adding 2nd domain controller (Server 2008 R2 64bit) to existing 2003 sp2 domain
Problems with protocol buffers
Which KEY do I use for my KMS Server and clients?
phpmailer errorInfo
XSLT Parsing pairs of xml tags
Crystal connection with OLE DB ADO
ESX 4.0 Does not detect onboard NIC