SqlParameters[1] = new SqlParameter("Date1", SqlDbType.SqlDateTime);
SqlParameters[1].Value = DBNull.Value;
SqlParameters[1].Direction = ParameterDirection.Input;
…then copy for the second.
More Related Contents:
- What are the pros and cons to keeping SQL in Stored Procs versus Code [closed]
- Passing List to SQL Stored Procedure
- What is passing parameters to SQL and why do I need it?
- Add WHERE clauses to SQL dynamically / programmatically
- Delete from two tables? [closed]
- Procedure or function xxxxx has too many arguments specified [duplicate]
- An unhandled exception of type ‘System.InvalidOperationException’ occurred in System.Data.dll?
- How to pass an array into a SQL Server stored procedure
- How to execute a stored procedure within C# program
- Calling stored procedure with return value
- Using stored procedure output parameters in C#
- Insert entire DataTable into database at once instead of row by row?
- Getting return value from stored procedure in C#
- SQL error: Incorrect syntax near the keyword ‘User’
- Query extremely slow in code but fast in SSMS
- How to retrieve data from a SQL Server database in C#?
- Using DateTime in a SqlParameter for Stored Procedure, format error
- Code to validate SQL Scripts
- Any way to SQLBulkCopy “insert or update if exists”?
- Entity Framework – stored procedure return value
- SQLException : String or binary data would be truncated
- Multi threading C# application with SQL Server database calls
- What’s the fastest way to bulk insert a lot of data in SQL Server (C# client)
- ALTER TABLE DROP COLUMN failed because one or more objects access this column
- How to pass XML from C# to a stored procedure in SQL Server 2008?
- Can I use ADFS 2.0 to authenticate certain users against SQL Server?
- ExecuteNonQuery returning -1 when using sql COUNT despite the query string
- How to insert data into SQL Server
- Database Error: There is no row at position 0
- Capturing count from an SQL query