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
Exchange 2010 Corrupted Receive Connectors in an inconsistenent state
Styling a Dropdownlist using CSS
Windows 7 Enterprise vs Ultimate?
How to replace a Exchange 2010 server suffering from a UNC rollback?
Hosted AD Domain Service - a best practice ?
Group and ungroup a password-protected sheet?
Silverlight ContentPresenter in Button Template
CSS wrong MIME type in Firefox on Apache, AddType text/css .css is there
Cross-forest trust: The domain controllers required to find the selected objects in the following domains are not available
Excel Chart Library Development in VB.NET/C#