Want To Make A Simple "date Selector" With 3 DDL's For Day / Month / Year?
May 29, 2010
I have never created a user control before. I want to make a simple "date selector" with 3 DDL's for day, month, year, and be able to re-use it numerous times on a page. I don't need to set any values of the control from the page itself, but I do need to read the DDL.selectedValues. I created the DDLs in the ascx file, but am not sure what properties to create. Does it make sense, or is it recommended, to create a public readonly property for each DDL _as_ a DDL? Or do I want to create a public property of type "string" and return the DDL.selectedValue as a string?
I have a column in report that should display month and year together i.e single column will have both month and year(this is the first column of the table).
I have a textbox that gets the date from an AJAX Calendar extender. What I need to do is extract the "month," "day," and "year," and put them into seperate string variables to use in my code to do various things based on the month, day or year respectively.
Here is what I have so far:
[code]....
But I don't want the year NOW, I want the year from the textbox.
Assuming I enter into TextBox txtReleaseDate a date in format month/day/year, then upon clicking an Update or Insert button, a CompareValidator control complains that date format is not valid. But if I enter date in format day/month/year, then object data source throws an exception Cannot convert value of parameter 'releaseDate' from 'System.String' to 'System.DateTime', while CompareValidator doesn't complain. I need the two controls to accept the same date format, so:
a) Since my DB stores date in format day/month/year, the best option would be for ODS to also accept this as valid date format. Can ODS be configured that way?
b)Can CompareValidator be configured to also accept month/day/year format?
I have 3 drop down lists for days,months and years,also i have a textbox to show the selected values from the 3 drop down lists when i select a month it shows in textbox and if i select another month it shows in textbox beside the first selected month.i want not to repeat the values in textbox.
i have complete date in a textbox i want to make the selected value in drop down list_days equal the day part of textbox,the selected value in drop down list_months equal the month part of textbox & the selected value in drop down list_years equal the year part of textbox to make the user update it if he want i tried to find the answer but i coudn't.
in visual web developer 2008 in "Query" Can I format the date to display only Month and year ?example: I have Complete date in my table like 05/04/2010. In Query in need to display only Month and year Like 04/2010 Or April/2010
How to extract Month from Date and then displaying the date using that extracted month??
I want to display dates according to Month. I have only "Date" column in database table.
I used below queries but it is not working:
string query= "SELECT EXTRACT(MONTH FROM date) AS Month FROM HolidayTable"; DataSet ds = new DataSet(query) int month = Convert.ToInt32(ds.Tables[0].Rows[0][0]); and string query2 = "select date from HolidayTable where date= '" + month + "' ";
DateTime ExpMonth = Convert.ToInt32(ddExpMonth); ---- DropDown(user selects a month) DateTime ExpYear = Convert.ToInt32(ddExpYear); ---- Dropdown(user selects year) Datetime ExpDate = ///// I want this part to be saved as Datetime 02/2012
Previous JULY Next Every time i press Previous, a variable mymonth subtracts 1 , and when if i press Next , the variable mymonth adds 1. Previous LINK: <%# mymonth - 1 %> Next LINK: <%# mymonth + 1 %>
All the schedule from the DB is shown, using the following SQL:
SELECT DISTINCT day(mydate) FROM schedule WHERE month(mydate)=" + mymonth + " AND year(mydate)=" + myyear + " ORDER BY day(mydate) ASC"
But my problems are:
- i want to show 3 months backwards from th actual month
- when mymonth is 1 (January) 2011 for example, it would show December, November and October from 2010
- If for example, we are in JULY, it would show until APRIL backwards, and when on APRIL it wouldnt show the PREVIOUS button.