How to display one selected record using DetailView? - c#

I have a form in ASP.Net Visual Studio that asks for particular details. After the user inputs their details into the database, I then want to be able to view their records and edit it in a different webform.
How can I view that one selected row of records in my form instead of viewing the entire database table?
I thought of using DetailView, however it still shows all the records in the database (just only one at a time).
Then I thought of using sessions but I don't know how about doing this?
Could I possible create a text box to input the persons username (primary key) and then that will open their details?
Update: What I don't want is the DetailView to have other details viewed as well. Meaning I don't want the records of other people on the DetailView as well. I just want the one record of that person, no one else's.

After saving to db, redirect to a new page posting the primary key data using suitable session management techniques & load the details with detailsview

Related

ADO.NET Project

I'm trying to create a project which is basically a library management system.
As a display I used the standard DataSource to WinForm drag and drop system, which displays everything shown in the SQL table.
I want the users to be able to see the content of each row in the grid by double clicking it, which would redirect to another page with the selected row number and information to be displayed on each field.
As for the admin side, I want to be able to modify my db (delete, insert).
Is this the right path, or should I draw a grid from scratch?
Also, my SQL table contains images, this is what's bugging me.
The default gridview shows the little red X's in the varbinary column, and I can't seem to get rid of that.
Regarding inserting data into the table, is there any way to add images directly from the system above? Or should I redirect to a new page and code the respective into textboxes and things of the sort?
Thank you in advance.

SQL Server 2008 get modified details

I have a table attached to a gridview in asp.net.
Lets say a user edits a row and updates the text in a textbox. I need to able to know what column he has modified and highlighted (ie make it bold).
This information needs to persist outside of the asp.net session so it would need to come from the DB.
How to go about pulling this info from the DB?
Add one more column to of updateTime in table and create a afterUpdate trigger which will insert updated time in that column.
Now you can differentiate the rows which have been updated recently from all other rows.

Showing Database Content in a Certain View on a Web Page

Ok so here is what am thinking. Am making a recruitment website to hire people. It gives a functionality to the applicant that he can build his cv online! i have made various forms for that.
After filling the forms the applicant will submit the information to database and then am saving all of the information from the webpages related to building cv in the database!
Am thinking of providing the applicant a tab on which when he clicks "View CV" and i show him the cv he built on a new web page in the format like this
http://careers.telenor.com.pk/Page/Detail/VacancyView.aspx?PositionID=3003265
Like the fields should be on the left as table columns and their respective content in the database on the right! Can anybody completely guide me how i can do that ?? or direct me to a specific tutorial ?? i would be grateful! Am using Asp.net!
I have seen grid view! Much like a table it is! with columns on the top and below the values in the database! That is not the thing i want!
DetailsView control can be used to display fields from a single data record. It has that "format" you are looking for.
You can find documentation in this link http://msdn.microsoft.com/en-us/library/s3w1w7t4.aspx

ASP.NET 2.0 Gridviews and people doing stuff they arent supposed to.

I have a page where a user can enter information into text boxes and upon submitting the information is saved to the database and the information is added to a gridview that they can select and edit the records from.
They shouldnt ever, but if they delete a record hit the back button in a browser and then select the record in the gridview again they are going to get out of range error because the record no longer exists in the database.
So I am looking for ideas on how to best keep this scenario from happening. Any suggestions are appreciated and i will be checking frequently to provide any additional information as I know this might be a little vague.
You should always handle the case where a user selects a record that does not exist because of the inherit nature of web applications...the data is stale as soon as the user sees it.
Even if the user just displayed the page for the first time it is possible another user deleted the record just after the results were retrieved.
I would suggest checking to see if the record exists, prompting the user in some manner that the data is stale and refresh the list automatically.
You could temporarily disable the back button with javascript?
http://csharpdotnetfreak.blogspot.com/2009/04/disable-browser-back-button-javascript.html

Display Table Data to the user in Visual Studio 2010

Because nobody answered to my previous questions I need to find a different solution.
So, if you can please help me I would appreciate it very much.
I need to present to the user that use the app some table data by his name and id.
In other words I have a table data about flights reservations that the user performed earlier.
that table contains flight reservations of all the users.
now I want that in case the user entered his user name and id I will show him all the data from the table that the columns userName and idNumber equals to his personal details.
How can I do this?
Where's the data coming from? If you're using a database, then databinding is going to be the simplest method of doing this. There are a ton of examples of databinding to a SQL database around the web. Here's one.
For showing only the selected user's data, you would add filters to the query appropriately. You can also search Google for ASP.net data binding and get a lot of examples.

Categories