This is how you explicitly set nvarchar(max):
cmd.Parameters.Add("@JobNumbers", SqlDbType.NVarChar, -1);
If you’re really concerned with performance you might want to consider passing a table of integers:
https://stackoverflow.com/a/10779593/465509
More Related Contents:
- Taking lot of time to read from SQL Server using c#
- Automated checking of database connection and query in same database [closed]
- Execute non-query error [closed]
- Delete from two tables? [closed]
- How to use DbContext.Database.SqlQuery(sql, params) with stored procedure? EF Code First CTP5
- Insert entire DataTable into database at once instead of row by row?
- Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework
- Is it necessary to manually close and dispose of SqlDataReader?
- LINQ to SQL multiple tables left outer join
- DropdownList DataSource
- Wildcard search for LINQ
- Map category parent id self referencing table structure to EF Core entity
- SqlParameter does not allows Table name – other options without sql injection attack?
- Get an IDataReader from a typed List
- Does using parameterized SqlCommand make my program immune to SQL injection?
- SQL update statement in C#
- Any way to SQLBulkCopy “insert or update if exists”?
- Entity Framework – stored procedure return value
- What’s the fastest way to bulk insert a lot of data in SQL Server (C# client)
- Direct method from SQL command text to DataSet
- Table name and table field on SqlParameter C#?
- Get affected rows on ExecuteNonQuery
- Checking for empty or null JToken in a JObject
- Add WHERE clauses to SQL dynamically / programmatically
- Index (zero based) must be greater than or equal to zero
- When is it better to write “ad hoc sql” vs stored procedures [duplicate]
- Issues Doing a String Comparison in LINQ
- Convert SQL to LINQ Query [closed]
- C# SQL insert command
- How do I extract data from a DataTable?