[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 430
  • Last Modified:

Gridview or DataGrid

Let me first start by saying I'm very new to ASP.net, and I'm trying to duplicate something that I've been doing in Visual Basic 6.0 on an ASP.net page.

Here is what I'm trying to accomplish and hopefully someone can tell me how I can do this using something like a GridView or something similar.

In my VB program I use a DataGrid to pull in a recordset that has rows like Endpoint Number, Endpoint Name, TransitAmt, TransitItems.  The Endpoint Number and Endpoint Name come from a SQL Stored Procedure and TransitAmt and TransitItems are set empty or zero in the recordset and using the DataGrid the user updates the endpoints with the correct Amounts and Item Counts.  Once the user has input the data and hit the OK button the data gets sent to another stored procedure that updates a different table then where the endpoints orginially came from.

To make this more simple I need to pull in data from one table using a stored procedure and update a different table using a stored procedure, with input from a Gridview or something simlar.  I can't use Text Boxes since the endpoints change from month to month and I don't want to have to constatly keep updating the page with new or delete text boxes.

Thanks,
smithmrk
0
smithmrk
Asked:
smithmrk
  • 2
1 Solution
 
Bob LearnedCommented:
GridView is a much better control, as the DataGrid is in there for backwards compatibility with ASP.NET 1.1 web sites.
0
 
Anurag ThakurCommented:
a sample for how you can edit your data and save it to the database using a gridview
http://www.dotnetfunda.com/articles/article29.aspx
0
 
smithmrkAuthor Commented:
Thanks for getting back to me, however as new as I am to this stuff none of what you said makes any sense to me.

Maybe I worded my question wrong.

In my VB Program I have a ADODB Recordset that I pull in all Fields from the SQL Stored Procedure.  I then bind this recordset to the DataGrid and allow the operators to enter the Item Amounts and Item Counts.  Once done I loop though the DataGrid and update the Database.

How can I do this in ASP.net using the Gridview or is there a DataGrid in ASP.net that I'm not aware of?

I don't mind using the GridView, but I seem to be having a hard time binding the ADODB Recordset to the GridView.

Sample Code would be great or some advice on how I can accomplish better.

Thanks,
smithmrk
0
 
Bob LearnedCommented:
ADO classic is old technology, and .NET is centered around ADO.NET, so you cannot bind a .NET control, like the GridView, to an ADODB RecordSet.

Have you learned anything about ADO.NET?  ASP.NET has an SqlDataSource class that you can use to get the data from the database, and binds directly to the GridView.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now