Re: Accessing object properties
Kevin wrote:
I'm looking for a way to create a generic function that will take a LinqToSql
object, a Field name and a value that will assign the value to the field. is
this possible?
Sure, but it has nothing to do with LINQ to SQL. If you have any object, you
can manipulate it through reflection -- Type.GetProperty() and friends
should do the trick.
Be aware that reflection carries a significant performance penalty. The
point of LINQ to SQL is to bridge the gap between objects and tables by
allowing strongly-typed access to the underlying database. If you're going
to use generic "set X to Y" logic, you're throwing away the benefits and you
might as well stick to using DataTable, which was made for just such an
approach.
--
J.
.
Relevant Pages
- Re: Are Linq-SQL methods commutative
... No - in LINQ each step effectively works off the result of the ... linq query which has to meet a SQL query they have in mind. ... freedom a SQL statement gives them: the SQL statement is the one ... (microsoft.public.dotnet.languages.csharp) - Re: LINQ Where 1=0
... The LinqDataSource control stores values for all primary keys ... Before LINQ to SQL updates or deletes data, it checks the values in view ... If the underlying data source contains a timestamp field that is ... (microsoft.public.dotnet.framework.adonet) - Re: Microsofts bridge between OO and relational
... Test Drive VB9 and DLinq ... The January 2006 Language Integrated Query (LINQ) preview for the next ... VB.NET, SQL Server 2005, XML, Visual Studio 2005, ... Without reading it all and accepting that a domain is nothing but a data type it has seemed to me a retrograde kind of introspection, even bizarre, to first make relations out of domains, then turn around and make those relations into data types. ... (comp.databases.theory) - Re: help with tables
... SQL0060W The "COBOL" precompiler is in progress. ... While I don't claim the same level of SQL knowledge that you have ... At the moment there is some debate as to whether the addition of LINQ ... I'd drop flat file support ... (comp.lang.cobol) - Re: approaches for embedding a data language in a general purpose language
... have made a wise decision with the linq projecthttp://msdn.microsoft.com/data/ref/linq/where they decided at some ... point to drop their interest in XQuery being handled like SQL. ... unrelated to a dbms the same way you handle data from a dbms. ... for (TObj t in TCollection) ... (comp.databases.theory) |
|