Re: SqlParameter and DBNull.Value - possible bug?



Martin Ret wrote:
Is following behaviour by design or is it a bug?
For shure breaking change from framework 1.1.

Try under framework => 2.0
SqlParameter param = new SqlParameter("Test", DbType.Int32);
Console.WriteLine("Value: {0}, Type: {1}",param.Value, param.DbType);
param.Value = DBNull.Value;
Console.WriteLine("Value: {0}, Type: {1} --- WTF",param.Value,
param.DbType); Console.ReadLine();

There was no way for you to know it (except maybe by browsing through
some of the previous questions in this newsgroup before posting yours -
always a recommended practice) , but this is a classic (COM-based) ADO
newsgroup. ADO.Net bears very little resemblance to classic ADO so,
while you may be lucky enough to find a dotnet-knowledgeable person
here who can answer your question, you can eliminate the luck factor by
posting your question to a group where those dotnet-knowledgeable people
hang out. I suggest microsoft.public.dotnet.framework.adonet.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


.



Relevant Pages

  • Re: datasets and table adapters dissapear from forms randomly!
    ... of the previous questions in this newsgroup before posting yours - always a ... but this is a classic ADO newsgroup. ... This email account is my spam trap so I ...
    (microsoft.public.data.ado)
  • Re: SQLNCLI - Parameters
    ... I suspect it's a limitation of the provider, ... some of the previous questions in this newsgroup before posting yours - ... ADO.Net bears very little resemblance to classic ADO so, ... posting your question to a group where those dotnet-knowledgeable people ...
    (microsoft.public.data.ado)
  • Re: DataSet not seeing results from two stored procedures
    ... I would suggest adding SET NOCOUNT ON to your procedure. ... some of the previous questions in this newsgroup before posting yours - ... ADO.Net bears very little resemblance to classic ADO so, ... posting your question to a group where those dotnet-knowledgeable people ...
    (microsoft.public.data.ado)
  • Re: Stored procedure returning multiple recordsets
    ... I have a stored procedure like this (it's the shortest I could come ... The same answer applies to both classic ADO and to ADO.Net: ... some of the previous questions in this newsgroup before posting yours - ... but this is a classic ADO newsgroup. ...
    (microsoft.public.data.ado)
  • Re: Fields with mixed string/number data
    ... some of the previous questions in this newsgroup before posting yours - ... but this is a classic ADO newsgroup. ... ADO.Net bears very little resemblance to classic ADO so, ... connection string. ...
    (microsoft.public.data.ado)

Loading