Can't update date in aspx to a MS-ACCESS table
Posted
by Bjork
on Stack Overflow
See other posts from Stack Overflow
or by Bjork
Published on 2010-04-16T13:50:14Z
Indexed on
2010/04/16
13:53 UTC
Read the original article
Hit count: 202
Hello I'm having problem with updating datatypes
I insert the date in the C# part like this
string strSQL = "INSERT into Frettir (CreatedBy,CreatedOn,Title,Description,Starts,Ends,CatId,SectionId,ArticleExt,Myndatexti,MyndUrAlbumi,NrMyndar) values(?,?,?,?,?,?,?,?,?,?,?,?)";
cmd.Parameters.Add("@Starts",OleDbType.Date).Value = dstartdate;
but I update in the aspx part like this
UpdateCommand="UPDATE [Frettir] SET [Title]=@Title,[Description]=@Description,[CreatedBy]=@notandaID,[ArticleExt]=@ArticleExt, [Myndatexti]=@Myndatexti,[Starts]=@Starts WHERE [ArticleID]=@id2 "
I get an error Data type mismatch in criteria expression It seems that there are some type differences between the type that is input in the c# part and the aspx-part
Can anyone help me with this?
© Stack Overflow or respective owner