Hello
I installed WebMatrix 2 and I created the site as a model of WebMatrix photogallery.
But when I want to update the name and description of a picture with the edit.cshtml page does not update the database without giving any message.
Then I tried to update the various fields from the database management WebMatrix and here comes out a message:
Impossibile eseguire il commit della modifica nel database.
Dopo aver fatto clic su OK sarà possibile correggere la voce non valida oppure premere ESC per annullare le modifiche.
Il valore dell'argomento specificato per la funzione non è valido. [ Argument # = 1,Name of function(if known) = like ]
System.Data.SqlServerCe.SqlCeException (0x80004005): Il valore dell'argomento specificato per la funzione non è valido. [ Argument # = 1,Name of function(if known) = like ]
in System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
in System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
in System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
in System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
in Microsoft.WebMatrix.DatabaseManager.SqlCeDatabase.SqlCeDatabaseProvider.EditRow(String connectionString, String tableName, String schema, IList`1 columnDataInfoList)
in Microsoft.WebMatrix.DatabaseManager.IisDbManagerModuleService.EditRow(DatabaseConnection databaseConnection, String tableName, String schema, ArrayList columnDataInfoArrayList, String configPathState)
in Microsoft.WebMatrix.DatabaseManager.Client.ClientConnection.EditRow(String name, String schema, ArrayList columnDataInfo)
in Microsoft.WebMatrix.DatabaseManager.Client.ClientTable.EditRow(ArrayList columnData)
in Microsoft.WebMatrix.DatabaseManager.Client.DataView.EditRow(RowData rowData, Object[] originalValues)
What should I do?
Thank you for your answers best regards and happy holidays
PS: The site in question is located here http://www.topgan.it/Album
Dear, It seems like you don't have this .dll file in your web project system.data.sqlserverce.
Please check and also can you post the error in english.
Thanks
With Regards
Abhishek Rajiv Luv
"Helpful then please Mark as Answer"
http://www.codeabstract.com/
http://pluralsight.com/training/users/abhishekluv
The problem arising from updating the database manually could be many things. the gallery template relies on data spread between tables each dependent on each other.
Let the system update the database by using edit.cshtml.
So, what error were you getting when you tried to update the fields using the edit page?
Hello and thank you very much for vopstre answers: Abhishek Luv you raggione in the bin folder I can not find the dll file from you segnalatami "System.Data.SqlServerCe." while it exists pc system.data.sqlserverceCe.dll.
and below the error in English:
"Unable to commit the changes in the database. After you click OK, you can correct the invalid entry or press ESC to cancel the changes. The specified argument value for the function is not valid. [Argument # = 1, Name of function (if known) like =]
And then everything as above. "
fozwold is certain but nothing happens when I go to update the page with the query edit.cshtml, does not give me any error but does not update always comes back as before. I put the code in the edit page:
@section Scripts {<scriptsrc="~/Scripts/jquery.validate.min.js"></script><scriptsrc="~/Scripts/jquery.validate.unobtrusive.min.js"></script>}@{Layout="~/_AlbumLayout.cshtml";varphotoId=UrlData[0].AsInt();vardb=Database.Open("PhotoGallery");varphoto=db.QuerySingle("SELECT * FROM Photos WHERE Id = @0",photoId);if(photo==null){Response.SetStatus(HttpStatusCode.NotFound);return;}WebSecurity.RequireUser(photo.UserId);Page.Title="Modifica foto - "+photo.FileTitle;Validation.RequireField("fileTitle","È necessario specificare un nome");Validation.RequireField("Descrizione","È necessario specificare una descrizione");if(IsPost&&Validation.IsValid()){varfileTitle=Request["FileTitle"];vardescription=Request["Description"];db.Execute("UPDATE Photos SET FileTitle = @0, Description= @1 WHERE Id = @2",fileTitle,description,photoId);Response.Redirect(Href("Visualizza",photo.Id));}Page.Url="/Photo/Edit/"+@photo.Id;}<h1>Modifica @photo.FileTitle</h1><sectionid="sidebar"><formmethod="post"><fieldsetclass="no-legend"><legend>Modifica @photo.FileTitle</legend><ol><li><labelfor="fileTitle">Nome:</label><inputtype="text"name="fileTitle"title="Nome foto"value="@photo.FileTitle"placeholder="Photo Name"@Validation.For("fileTitle")/>@Html.ValidationMessage("FileTitle")</li><li><labelfor="description">Descrizione:</label><textareaname="description"title="Descrizione foto"rows="4"cols="30"placeholder="Photo description"@Validation.For("description")>@photo.Description</textarea>@Html.ValidationMessage("Description")</li></ol><pclass="form-actions"data-role="controlgroup"data-type="horizontal"><inputtype="submit"value="Salva modifiche"title="Salva modifiche"/><adata-role="button"href="~/Photo/View/@photoId"title="Cancel changes">Annulla</a></p></fieldset></form></section><imgalt="@Html.AttributeEncode(photo.FileTitle)"src="~/Photo/Thumbnail/@photo.Id?size=large"/>
Hello and again many thanks and sorry for my english Happy Holidays
Hello fozwold
You are absolutely raggione I changed the D, with the de everything works perfectly, think for a typo made by the inventor of the model gallery.
Thanks a million and tantisimi WISHES to you and your family
TopGan
Member
3 Points
7 Posts
Errore di WebMatrix
Dec 22, 2012 10:00 AM|LINK
Hello
I installed WebMatrix 2 and I created the site as a model of WebMatrix photogallery.
But when I want to update the name and description of a picture with the edit.cshtml page does not update the database without giving any message.
Then I tried to update the various fields from the database management WebMatrix and here comes out a message:
Impossibile eseguire il commit della modifica nel database.
Dopo aver fatto clic su OK sarà possibile correggere la voce non valida oppure premere ESC per annullare le modifiche.
Il valore dell'argomento specificato per la funzione non è valido. [ Argument # = 1,Name of function(if known) = like ]
System.Data.SqlServerCe.SqlCeException (0x80004005): Il valore dell'argomento specificato per la funzione non è valido. [ Argument # = 1,Name of function(if known) = like ]
in System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
in System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
in System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
in System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
in Microsoft.WebMatrix.DatabaseManager.SqlCeDatabase.SqlCeDatabaseProvider.EditRow(String connectionString, String tableName, String schema, IList`1 columnDataInfoList)
in Microsoft.WebMatrix.DatabaseManager.IisDbManagerModuleService.EditRow(DatabaseConnection databaseConnection, String tableName, String schema, ArrayList columnDataInfoArrayList, String configPathState)
in Microsoft.WebMatrix.DatabaseManager.Client.ClientConnection.EditRow(String name, String schema, ArrayList columnDataInfo)
in Microsoft.WebMatrix.DatabaseManager.Client.ClientTable.EditRow(ArrayList columnData)
in Microsoft.WebMatrix.DatabaseManager.Client.DataView.EditRow(RowData rowData, Object[] originalValues)
What should I do?
Thank you for your answers best regards and happy holidays
PS: The site in question is located here http://www.topgan.it/Album
Abhishek Luv
Participant
1736 Points
468 Posts
Re: Errore di WebMatrix
Dec 22, 2012 10:08 AM|LINK
Dear, It seems like you don't have this .dll file in your web project system.data.sqlserverce.
Please check and also can you post the error in english.
With Regards
Abhishek Rajiv Luv
"Helpful then please Mark as Answer"
http://www.codeabstract.com/
http://pluralsight.com/training/users/abhishekluv
fozwold
Member
16 Points
14 Posts
Re: Errore di WebMatrix
Dec 22, 2012 11:22 AM|LINK
can you post your code?
You need to address the prolem with edit.cshtml
The problem arising from updating the database manually could be many things. the gallery template relies on data spread between tables each dependent on each other.
Let the system update the database by using edit.cshtml.
So, what error were you getting when you tried to update the fields using the edit page?
TopGan
Member
3 Points
7 Posts
Re: Errore di WebMatrix
Dec 22, 2012 03:46 PM|LINK
Hello and thank you very much for vopstre answers: Abhishek Luv you raggione in the bin folder I can not find the dll file from you segnalatami "System.Data.SqlServerCe." while it exists pc system.data.sqlserverceCe.dll.
and below the error in English:
"Unable to commit the changes in the database. After you click OK, you can correct the invalid entry or press ESC to cancel the changes. The specified argument value for the function is not valid. [Argument # = 1, Name of function (if known) like =] And then everything as above. "
fozwold is certain but nothing happens when I go to update the page with the query edit.cshtml, does not give me any error but does not update always comes back as before. I put the code in the edit page:
Hello and again many thanks and sorry for my english Happy Holidays
fozwold
Member
16 Points
14 Posts
Re: Errore di WebMatrix
Dec 23, 2012 09:47 PM|LINK
does it perform the redirect?
try changing the Request["Description"]
to Request["description"]
the name of the field in the form is description....with a little d
TopGan
Member
3 Points
7 Posts
Re: Errore di WebMatrix
Dec 24, 2012 06:53 AM|LINK
Hello fozwold
You are absolutely raggione I changed the D, with the de everything works perfectly, think for a typo made by the inventor of the model gallery.
Thanks a million and tantisimi WISHES to you and your family