Oledb parameterized query sqlserver ce does not support?

  • OleDbConnection con = new OleDbConnection(constring);

    con.Open();

    string qry2 = "select * from [dbo.TblCategory] where Name=?";

    OleDbCommand cmd = new OleDbCommand(qry2, con);

    System.Data.OleDb.OleDbParameter p = new OleDbParameter("@p1", OleDbType.VarWChar);

    p.Value="demo";

    cmd.Parameters.Add(p);

    OleDbDataReader rdr = cmd.ExecuteReader();

    It throws error type is not supported.when i use SqlCeCommand ,error does not occurs. i need it to work with Oledb anuy idea?

    i use sqlserver 2005 compact edition.c#.net 2.0

  • Hey,

    I've got a similar problem. But in my case, it isn't working with more than one parameter:

    http://social.msdn.microsoft.com/Forums/de-DE/sqlce/thread/28a24ce8-6b54-4e8a-af77-58fa91b497e3

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply