Click here to Skip to main content
15,868,419 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i'm trying to get monthly attendance details of a student,while whenever i'm selecting a month in drop down list. how will we bind drop down list to text box to display monthly details based on selection ??
Posted
Updated 21-Jun-15 22:33pm
v2
Comments
Akhil Mittal 22-Jun-15 4:09am    
Your question is very unclear w.r.t. to textbox you mentioned.
What I understand is you want to fetch attendance details on dropdown selection change and show the data into a text box.If this is so, then you can just display the values into text box on selection change event of dropdown list.Just display the details that you fetch into textbox whenever the dropdown selection changes.
Member 11782598 22-Jun-15 4:18am    
do u have related query based on that?
F-ES Sitecore 22-Jun-15 4:41am    
How can we tell you what the query will be if we don't know your database schema? You need to break your problem down into smaller chunks and tackle each chunk, preferably using google to find tutorials etc and asking specific questions if you are stuck.

1 solution

Can't suggest a full solution without seeing your code and database structure but, you may follow these steps to get it solved-
1. Set AutoPostBack property of dropdownlist to True
2. In SelectedIndexChanged event of the dropdownlist, retieve required data from database. Query something like following may help
SQL
SELECT ColName
FROM TableName
WHERE StudId=@StudId --value for the selected student id
AND DATEPART(MONTH,AttendanceDate)=@Month --Numeric equivalent for month

3. Save the result to a string variable
4. Assign the value kept in the string variable to the text.

Hope, it helps :)
 
Share this answer
 
Comments
Member 11782598 22-Jun-15 8:57am    
If that drop down list will be in grid view means how can we handle that?along with all reamaining column values.

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