Menu

#12 Parameter problem with Npgsql when data type is not explicit

open-accepted
runtime (7)
9
2005-03-29
2004-11-15
Anonymous
No

Here is the code

string queryString = "SELECT * FROM Calendar WHERE
\"YEAR\" = @date";
AdpCommand dbCommand = new AdpCommand(queryString,
Connection);
AdpParameter dbParam =
dbCommand.CreateParameter("@date", 2004);
dbParam.DbType = DbType.Int32;
dataReader = dbCommand.ExecuteReader();

if you comment the explicit assignment of data type a
Null reference exception appears. However, this is not
the case if the native Npgsql classes were used instead
of ADP.

Thanks and God Bless!

Discussion

  • Everaldo Canuto

    Everaldo Canuto - 2004-11-26
    • labels: --> runtime
    • priority: 5 --> 9
    • assigned_to: nobody --> everaldo_canuto
     
  • Fábio David Batista

    • status: open --> open-accepted
     
  • Fábio David Batista

    • assigned_to: everaldo_canuto --> uruz
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.