Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SqlParameter.SqlDbType behavior
Message
De
15/03/2016 21:20:33
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
SqlParameter.SqlDbType behavior
Versions des environnements
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01633145
Message ID:
01633145
Vues:
38
When we create a Sql parameter such as:
loSqlParameter = New SqlParameter()
...this creates loSqlParameter.SqlDbType by default to NVarChar.

Then, if we assign a date value such as '2015-01-01 00:00:00' to loSqlParameter.Value, this will adjust automatically loSqlParameter.SqlDbType to DateTime.

So, up to this point, the SQL data provider is reacting like this.

For years, I was passing a value such as '20150101 00:00:00' from a specific robot task and this was also recognized as a DateTime. Since a few weeks, I found out that our UAT environment was generating errors on that code, with an Invalid column index: "36768", because the default to NVarChar was preserved instead of being adjusted automatically to DateTime as before.

The production does not have the issue.

So, is anyone aware of an update which could have changed the way the SQL data provider reacts? Because, before, I was able to pass a date value, as a parameter, in an ISO format and it would work.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform