• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 452
  • 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.

  • 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.
Anurag ThakurTechnical ManagerCommented:
a sample for how you can edit your data and save it to the database using a gridview
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.

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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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