Click here to Skip to main content
16,012,468 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have screen with textbox with ID txtid and search button with ID btnsearch and a gridview with id GridviewID
i have to show the data with person image in grid view by enter person ID in the text box and click the search button .
Posted
Comments
[no name] 3-May-13 20:47pm    
Okay...and? What is your question?

1 solution

Create a parameterized query or stored procedure that returns the Person information based on the PersonID passed from your front-end. Execute this query from your code-behind (the Search button even) passing in the value entered from the txtID textbox. Return the result, and then assign that result to your GridView. Below is a simple example of the stored procedure.

SQL
CREATE PROCEDURE GetPersonByID
(
	@PersonID INT
)
SELECT * FROM Person
WHERE
	PersonID = @PersonID
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900