-
Notifications
You must be signed in to change notification settings - Fork 317
Closed
Labels
Waiting for Customer ⏳Issues/PRs waiting for user response/action.Issues/PRs waiting for user response/action.
Description
Describe the bug
With a connection to a SQL Server 2005 Database, SqlCommandBuilder.DeriveParameters is creating Parameters of SqlDbType.Variant when the parameter is of type Int
To reproduce
string connString = @"Server=SQL2005_INSTANCE;Database=DB_NAME;UID=sa;Password=YOUR_PASSWORD;TrustServerCertificate=True;";
Microsoft.Data.SqlClient.SqlConnection conn = new Microsoft.Data.SqlClient.SqlConnection(connString);
conn.Open();
Microsoft.Data.SqlClient.SqlCommand command = new Microsoft.Data.SqlClient.SqlCommand("STORED_PROC_NAME", conn);
command.CommandType = CommandType.StoredProcedure;
Microsoft.Data.SqlClient.SqlCommandBuilder.DeriveParameters(command);
conn.Close();
SqlDbType dbtype = command.Parameters[1].SqlDbType;Expected behavior
Parameters Type be of the right type according to the procedure
Further technical details
Microsoft.Data.SqlClient version: 5.0.0
.NET target: (.NET 6)
SQL Server version: (SQL Server 2005)
Operating system: (Windows 8)
Additional context
System.Data.SqlClient 4.8.3 has the same problem.
Metadata
Metadata
Assignees
Labels
Waiting for Customer ⏳Issues/PRs waiting for user response/action.Issues/PRs waiting for user response/action.