Click on one DataField in gridview will open a new grid view - sql

My Target:
I have one gridview on the asp page now the first column is showing some numbers (which is primary key in SQL)
Now I want if someone clicks on any of the number he should be navigated to a new page where he can edit the fields connected to the number clicked.
Note: in the first grid view I have not selected all the columns from sql but in the editing page i want most of the columns from database.

Broad ask. Guess you added right tag asp.net but you mentioned asp page.
Add hyperlink in the id column of gridview to navigate to edit page with Primary key value as querystring.
In pageload of editing page, read the querystring & query all the Columns of record you need using id, edit & update the DB. At the end response.redirect to grid page.

Related

How to insert multiple records into database table using gridview in asp.net using vb.net?

I wish to develope an asp page using vb.net, using which one can insert more than one records
at a time for example "Item Order Placing form" in which one can place more than one order and can see its whole order also so how can it be possible using gridview with vb.net ?
You should really try first... and then post code you have a problem with. One possible solution would be to have a listview or gridview and an area below where the person enters each order item one at a time. When order complete click button. This fill fire code which you need to write that will go through each row and add to db.

How to enter a value from data grid view into a label?

I am using Visual Basic Express.
What I want to do is to allow user to select a row from data grid view that is connected to MS SQL database. When the user selects a row and then clicks on a button, the so-called search form closes. Now, what I want to do is to copy the values of two out of four columns in data grid view to a label on a different form, so that a user can be sure that he selected the right row before proceeding.
Any ideas?
Found a solution! If anyone needs it, here it is:
form.Label1.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value & " " & DataGridView1.Rows(e.RowIndex).Cells(2).Value
This code will replace the text in a label with the values from columns with indexes 1 and 2 divided by a blank space.

Struts 1 - How to pick up a table row values to process in another JSP page

I'm facing this trouble: I have a <table> filled (<logic:iterate>) with some data coming from an Action, the last value (of each table row) is a link that would drives me to another JSP page with the data of the row where the link was clicked to edit the corresponding values.
The fact is that I don't have any idea how to grab the values from that row and pass they to the other JSP page once the link is clicked.
Any ideas / example / implementation?!?!
The code that creates the link (in your table rendering JSP) can embed the ID of the object for that row in the link as query parameter such as ?objectId=13AB73C. (For security reasons it's even better to embed a unique hash of the ID rather than an actual database id). That id can then be obtained from the request parameters.
Once you have the id of the object for the row, you can load the data from the database for your editing page.

Display Hyperlink field on rows based on value from the database

How do I dynamically display the 'Edit' on the hyperlink field based on the values on the rows, generated from the database.
N/B.: the gridview automatically generates rows.
Do you mean you want a DataGridViewLinkColumn in the grid with Edit displayed if appropriate? Like this:
In which case, make the whole column a LinkColumn and whether or not it's clickable will be taken care of internally by the grid. Columns which don't display Edit will not be clickable.
If you don't mean this then please provide more detail.

Individual Record Subform

I am fairly new to access and I am wondering about a form.
In my form, I want to have certain field values displayed based upon which row the user selects.
So, pretend a user selects Row B, I want a subform that displays data from only Row B.
Is this possible, and if so how? :)
Thanks!
You don't even need a subform for this.
Your main form is a continuous form and your data rows are displayed in the form's detail area, right?
If yes, you can just put bound textboxes in the form header or footer, and they will display the value of the selected row.
Here are some example screenshots I just made.
It's Access 2000 and it's in German (that's the only Access version that I have here), but you'll get the idea.
Design mode:
("Formularkopf" means "form header", and "Detailbereich" is "Detail" in English Access versions.)
At runtime:
Note that the textbox in the form header, which is bound to Field2, automatically displays the value of Field2 in the currently selected row.