Это странно для меня.Невозможно добавить SqlParameter в SqlCommand
Сигнатура метода Add
параметра требует SqlType
, но когда я использую, что
//Create and open a connection to SQL Server
SqlConnection connection = new SqlConnection(DatabaseHelper.ConnectionString);
connection.Open();
//Create a Command object
SqlCommand command = new SqlCommand("stpInsertFile", connection);
command.CommandType = System.Data.CommandType.StoredProcedure;
command.Parameters.Add("@LastMod", System.Data.SqlTypes.SqlDateTime);
он показывает эту ошибку:
'System.Data.SqlTypes.SqlDateTime' is a 'type', which is not valid in the given context
Ok спасибо за объяснение. Кажется, я слишком долго смотрел на экран! – JohnnyBizzle