DAAB - SqlCeParameter

Topics: Data Access Application Block
Aug 16, 2007 at 4:10 PM
I used DAAB with SqlCe. There seems to be some bug, or am I missing something here?
So, all I did is executing simple query with parameters.

The query I used:
INSERT INTO t_Buyer(Name, Address1, Address2, Phone, Fax, Note, Code)
VALUES(@Name, @Address1, @Address2, @Phone, @Fax, @Note, @Code)_

The Code:
DbCommand cmdInsert = _Database.GetSqlStringCommand(QueryInsert);
_Database.AddInParameter(cmdInsert, "Name", DbType.String, NewBuyer.Name);

The error says: An SqlCeParameter with ParameterName "@name" is not contained by this SqlCeParameterCollection.

After googling around, I found a post (http://geekswithblogs.net/marcel/archive/2006/10/01/92876.aspx) that says, I have to use "@Name" instead of "Name" when inserting the parameter. CMIIW, but I thought that it is best to leave "@" sign to preserve the database-agnostic feature? Is DAAB missing this feature, or is there another workaround?

Thanks
Best Regards,

Ferry Mulyono