As Peter said the actual db addition of a null would be System.DbNull.
But i am guessing you want to also know how to make your method allow null
parameter values?
if so its like this
public void InsertRow(char gender, double? decimalAge, double? height,
double? weight)
{
//Adds data into a MySQL database
}
the ? after double, double? or with an int, int? just means it can have a
null value. When inserting that null into db use the System.DbNull.
"Paul C. Jarvis" <pjarvis@man.ac.ukwrote in message
news:Za-dnRifyeRpk0zYRVnyuQA@giganews.com...
Quote:
Hi guys,
>
Say for example i have a hypothetical function taking 4 parameters such as
the one below:
>
public void InsertRow(char gender, double decimalAge, double height,
double weight)
{
//Adds data into a MySQL database
}
>
If i have a piece of data missing such as height, but i still want to call
the function that will add the other parameters into the database, how
would i do it? I'd like to pass
a 'null' to the function, is there any way of achieving this without
getting compiler errors?
>
Thanks in advance
>
Paul
>
>
--
--------------------------------- --- -- -
Posted with NewsLeecher v3.8 Final
Web @
http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -
>