Answered by:
How to change the following code in VB.net in order to use it in asp.net using VB

Question
-
User803642803 posted
, I got the following errors:
- row is not member of GridView
-
Me.Qty.Index in not member of GridView
For Each rows As DataGridViewRow In Me.InvoiceDetailsDataGridView.row If Row.Cells(Me.Qty.Index).Value = "" Then Exit For strSQL = "INSERT INTO InvoiceDetails (InvoiceID, Qty, ProductName, Price) VALUES(" & identity & ", " & Row.Cells(Me.Qty.Index).Value & ",'" & Row.Cells(Me.ProductName.Index).Value & "'," & Row.Cells(Me.Price.Index).Value & ")" cmd = New SqlCommand(strSQL, conn) cmd.ExecuteNonQuery() Next Row
Monday, September 19, 2016 10:54 AM
Answers
-
User753101303 posted
Hi,
ASP.NET uses GridView and GridViewRow types. Not sure in which object you have this (typed dataset).
You likely have better ways to do that. You could consider having a look at http://www.asp.net/web-forms/overview/presenting-and-managing-data/model-binding/retrieving-data
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, September 19, 2016 11:33 AM -
User1724605321 posted
HI Ayman Qadah ,
Also see below code samples (not use model binding ) .You could perform CRUD in GridView like :
http://www.encodedna.com/gridview/tutorial/perform-crud-operation-using-gridview-aspdotnet.htm
using Stored Procedure with SQL Server database backend in ASP.Net like :
Best Regards,
Nan Yu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 20, 2016 5:28 AM
All replies
-
User753101303 posted
Hi,
ASP.NET uses GridView and GridViewRow types. Not sure in which object you have this (typed dataset).
You likely have better ways to do that. You could consider having a look at http://www.asp.net/web-forms/overview/presenting-and-managing-data/model-binding/retrieving-data
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, September 19, 2016 11:33 AM -
User1724605321 posted
HI Ayman Qadah ,
Also see below code samples (not use model binding ) .You could perform CRUD in GridView like :
http://www.encodedna.com/gridview/tutorial/perform-crud-operation-using-gridview-aspdotnet.htm
using Stored Procedure with SQL Server database backend in ASP.Net like :
Best Regards,
Nan Yu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, September 20, 2016 5:28 AM