Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi how to add table in hotlist...

Name:s
Middle Name:M

ViewDetails(link button) Add TO Favorite(link button)
when i click to add to favorite link button it should save in add to favorite list page in data list..can any one help me?
Posted
Updated 22-Dec-11 2:16am
v2

Just update the status in your Table. Consider your table contains the below data
-------------------------------------
Name          MiddleName   IsFavorite
-------------------------------------
AAAAAAA       1111111111       Y
BBBBBBB       2222222222       Y
CCCCCCC       3333333333       N
DDDDDDD       4444444444       Y
EEEEEEE       5555555555       N
-------------------------------------

If you want to add a record to favorite list then update.
SQL
UPDATE [Table] SET IsFavorite='Y' WHERE [Name]='DDDDDDD'

Use the below query to get favorite list
SQL
SELECT * FROM [Table] WHERE IsFavorite='Y'

Using the above query you can pull the data to frontend, then bind it to Gridview or something.
C#
DataTable dt = GetFavoriteList();//Custom function to get data from database
GridFavorites.DataSource = dt;
GridFavorites.DataBind();
 
Share this answer
 
Comments
Shahriar Iqbal Chowdhury/Galib 22-Dec-11 15:51pm    
good one
ythisbug 22-Dec-11 23:45pm    
suppose if there is no column as favourite in sql..and only in link button i have to add to in favourite list i mean in different page..how do u write the code..???
thatraja 23-Dec-11 1:03am    
There is no way, You must store the details somewhere(database or XML). Just create a column there. Its the permanent solution.
Download the following open source project and review the architecture:
Jobs Site Starter Kit for ASP.NET 3.5
Open Source C#, VB.NET, ASP.Net Projects
 
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