Parameter has no value

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-06-15T12:25:20Z Indexed on 2010/06/17 11:23 UTC
Read the original article Hit count: 225

Filed under:
|
|
|
|
string queryString = "SELECT SUM(skupaj_kalorij)as Skupaj_Kalorij  "
                    + "FROM (obroki_save LEFT JOIN users ON obroki_save.ID_uporabnika=users.ID)"
                    + "WHERE users.ID= " + a.ToString() + " AND obroki_save.datum =?";


using (OleDbCommand cmd = new OleDbCommand(queryString,database))                                    
{
    cmd.Parameters.Add("@datum", OleDbType.Char).Value = DateTime.Now.ToShortDateString();    
}

Why doesn't the parameter datum get the date value? (the value of at least one complex parameter has not been determined )

© Stack Overflow or respective owner

Related posts about c#

Related posts about ms-access