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
Data Encryption Software
Ethernet crossover cable connect
Batch File: Remove spaces in variable
Cisco PtP VPN
Question about Exchange 2010 mailbox move.
SBS 2008 - STOP c00002e2
I want to make Liberty reserve API
quorum drive
osx system no longer logging into windows domain
Sharepoint|IIS| Web Application port number