score:3
the executecommand
and executequery
methods of the datacontext
class take a simple parameter (params object[]
) array. there are a few gotchas when it comes to those, but for the most part they work fine and are less code to write than populating the parameters of a sqlcommand
.
context.executecommand("exec usp_updateproductname {0}, {1}",
productid, productname);
that's all there really is to it.
score:1
you could have your sp take in an xml data type parameter and you could loop through and dynamically create the value of that parameter. then the stored proc would know what to expect in the xml parameter....that is a way to pass in a variable length parameter into the database.
Source: stackoverflow.com
Related Query
- LINQ to Stored Procedure. Can I call the SP with a dynamic list of parameters instead of strongly typing them?
- Pass multiple parameters to call stored procedure with LINQ
- Lost decimal precision and scale using LINQ and stored procedure with output parameters
- How can I speed up this linq query on a List<> with search criteria on 3 attributes in the list object
- Using LINQ with stored procedure that returns multiple instances of the same entity per row
- NHibernate Linq with subquery returns 'Only one expression can be specified in the select list when the subquery is not introduced with EXISTS'
- c# linq to sql with a stored procedure containing dynamic sql
- Linq stored procedure with dynamic results
- How can I call a stored procedure with INSERT using LINQ?
- Dynamic Where in linq with list parameters in action asp.net mvc
- How can I access the result of dynamic linq with dynamic key/value pairs of IEnumerable?
- how can i call the delete store procedure in linq query
- Using stored procedure in Entity Framework with input parameters - how to use in Linq query?
- Filtering with multiple parameters with Linq or stored procedure
- call stored procedure with linq
- Is it Possible to call a Stored Procedure using LINQ in LINQPad?
- How can you do custom sorting in LINQ with null always on the end?
- How to get linq `ForEach` statement to return data on the method call being made for each list object?
- Stored Procedure return values with linq data context
- How to implement SkipWhile with Linq to Sql without first loading the whole list into memory?
- LINQ Where clause with Contains where the list has complex object
- Getting stored procedure output parameter with LINQ and Entity Framework
- LINQ with subselect and groupby to get only the latest version of each item in a list
- How can I build Linq query with dynamic OR statements?
- How can I split a list vertically in n parts with LINQ
- Change the order of List items conditionally with LINQ
- How can I create a dynamic LINQ query in C# with possible multiple group by clauses?
- How do you sort a String List by the number of words matched with an Array in Linq
- How can I group by the difference between rows in a column with linq and c#?
- Linq - How can a add the contents of two list
More Query from same tag
- Return Array from Linq Query
- copy chosen properties to object of other type
- Parse XML with XDocument C#
- the best way to convert delimited to fixed width
- What conflicts might I encounter using MongoDB.Driver.Linq and System.Linq in the same namespace?
- Using LINQ with different layers means I can't access a specific type
- ORM and SOA in the .NET world
- How to split and trim a string in one line
- order by and file.exist() c#
- How to find the position(not Id) of an Item in a sorted Linq list
- Get another attribute on the same element by searching another attribute
- The name 'con' does not exist in the current context
- LINQ - join 2 datatables - wildcard
- C# LINQ to SQL - how to Replace inside "..."?
- How to do cascade splitting with C# Linq - multiple foreach split
- Give a number to return the approximated value of an Enum?
- Convert SQL to Linq queries in Entity Framework
- Filter JSON by key name using LINQ
- Can I do a Where Clause on this LINQ Query?
- The Type of one of the Expression in the join clause is incorrect.Type inference failed in the call to join
- Getting Random File from Directory Tree
- Full outer join with linq for 3 tables
- Where is IQueryable in the .NET Compact Framework?
- Use Linq to search through table for items from a custom class
- Linq select with join
- Multiple LinqToSQL queries and performance
- Linq Lambda get two properties as string from aggretation
- Is there a way to use `dynamic` in lambda expression tree?
- Can't find XDocument and XElement
- LINQ: Concatenate/Union multiple sequences