Leave a Reply

171 Comments on "Create a webshop with Asp.Net – Part 5"

Notify of
avatar

Agithrah Kamalanthan
Guest
Agithrah Kamalanthan
1 month 27 days ago
if (!string.IsNullOrWhiteSpace(Request.QueryString["id"])) { string customerId = "-1"; int id = Convert.ToInt32(Request.QueryString["id"]); int amount = Convert.ToInt32(ddlAmount.SelectedValue); Purchase purchase = new Purchase { Amount = amount, CustomerID = customerId, Date = DateTime.Now, IsInCart = true, ProductID = id }; PurchaseModel model = new PurchaseModel(); lblResult.Text = model.InsertPurchase(purchase); } }Error:can not implicitly convert type 'string' to 'int'Help pleaseeee
Diogo Lança
Guest
Diogo Lança
23 days 20 hours ago

Your problem isn't theres, make sure you have the fillPage method correct also, if it is correct it's probably you database that's wrong

James Arnold
Guest
James Arnold
3 months 11 days ago

Having an issue with #ContentPlaceholder1_pnlProducts style. Its not changing anything on my Index.aspx panel. The pictures an info are there. Huge picture and not change to font. Im using visual studio 2015.

gonçalo daniel
Guest
gonçalo daniel
2 months 10 days ago

u already helped?

Earth Kom
Guest
Earth Kom
3 months 13 days ago

when adding to cart i get an error message An error occurred while updating the entries. See the inner exception for details. —> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. —> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Purchase_Customer". The conflict occurred in database "Garage", table "dbo.Customer", column 'ID'. The statement has been terminated

Timur Misharin
Guest
Timur Misharin
3 months 20 days ago
Have Exception on Add Product button???System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. –> System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. —> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Purchase_Customer". The conflict occurred in database "C:USERSADMINDOCUMENTSWEBSTOREWEBSTOREWEBSTOREAPP_DATAWEBSTORE.MDF", table "dbo.Customer", column 'ID'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at… Read more »
sally knox
Guest
sally knox
5 months 18 hours ago

My images are not displaying from left to right, just vertically. What am i doing wrong?

Mihaela Buga
Guest
Mihaela Buga
14 days 20 hours ago

Did you find the mistake? I am the same problem.

gonçalo daniel
Guest
gonçalo daniel
2 months 10 days ago

diogo? can u contact me? whatsapp: +351 927215330email: goncasdanny@hotmail.com

Diogo Lança
Guest
Diogo Lança
3 months 17 days ago

If the images are in the css style size but not horizontally, make sure you wrote the css content #ContentPlaceHolder1_pnlProducts properly, in my case I had one letter as lowercase in css and uppercase in the Id, the css tags have to match the Id you gave exactly, it fixed my vertical issue

sally knox
Guest
sally knox
5 months 18 hours ago

My images are not displaying from left to right, just vertically. What am i doing wrong?

webbeech Technologies
Guest
webbeech Technologies
6 months 12 days ago

pnlProducts.Controls.Add(productPanel); error is coming can you tell me wot is the problem bro (System.NullReferenceException was unhandled by user code)

webbeech Technologies
Guest
webbeech Technologies
6 months 12 days ago

pnlProducts.Controls.Add(productPanel); error is coming can you tell me wot is the problem bro (System.NullReferenceException was unhandled by user code)

Hannah Bien
Guest
Hannah Bien
7 months 8 days ago
if (!string.IsNullOrWhiteSpace(Request.QueryString["id"])) { int id = Convert.ToInt32(Request.QueryString["id"]); ProductModel model = new ProductModel(); Product product = model.GetProduct(id); //Fill page with data lblTitle.Text = product.Name; lblDescription.Text = product.Description; lblPrice.Text = "Price per unit:<br/>£ " + product.Price; imgProduct.ImageUrl = "~/Images/Products/" + product.Image; lblItemNr.Text = product.ID.ToString(); //Fill amount list with numbers 1-20 int[] amount = Enumerable.Range(1, 20).ToArray(); ddlAmount.DataSource = amount; ddlAmount.AppendDataBoundItems = true; ddlAmount.DataBind(); }I cannot view the the details when I click the photo
Hannah Bien
Guest
Hannah Bien
7 months 8 days ago
if (!string.IsNullOrWhiteSpace(Request.QueryString["id"])) { int id = Convert.ToInt32(Request.QueryString["id"]); ProductModel model = new ProductModel(); Product product = model.GetProduct(id); //Fill page with data lblTitle.Text = product.Name; lblDescription.Text = product.Description; lblPrice.Text = "Price per unit:<br/>£ " + product.Price; imgProduct.ImageUrl = "~/Images/Products/" + product.Image; lblItemNr.Text = product.ID.ToString(); //Fill amount list with numbers 1-20 int[] amount = Enumerable.Range(1, 20).ToArray(); ddlAmount.DataSource = amount; ddlAmount.AppendDataBoundItems = true; ddlAmount.DataBind(); }I cannot view the the details when I click the photo
1 2 3 13
wpDiscuz