score:1
Accepted answer
DateTime date = Convert.ToDateTime(DropDownListDate.SelectedValue.ToString());
score:0
string dateString = DropDownListDate.SelectedValue.ToString();
string format = "dd/mm/yyyy";
DateTime dateTime = DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture);
string strNewDate = dateTime.ToString("yyyy-dd-mm");
score:0
var date = Convert.ToDateTime(DropDownListDate.SelectedValue);
var selectedDate = from d in datacontext.Appointment
where d.AppointmentDate == date
select d;
Source: stackoverflow.com
Related Query
- How to Convert Items of Dropdownlist to datetime?
- How to convert DateTime to TimeSpan in Entity Framework query
- How can I convert DateTime to String in Linq Query?
- How can I select items with Linq by Date while ignoring Time portion of a DateTime property?
- How to convert string to DateTime in C# EF Core query
- How to convert Timestamp Datatype value in SQL in Datetime format in C# by using LINQ?
- How to convert UTC datetime column to local time in datagridview?
- How to convert DateTimeOffset to DateTime in Linq
- How to convert all date-formatted cells in IRange to DateTime using Spreadsheet Gear C#?
- how to convert string into DateTime in where Clause?
- How can I convert a DateTime variable in a LINQ expression?
- How can I convert all DateTime properties to a different TimeZone in a collection?
- how can i convert datetime exactly to sql server datetime using linq
- how to convert UTC dateTime to local datetime
- how to convert MM/dd/YYYY hh:mm:ss AM to YYYY-MM-dd datetime format by linq?
- How to convert Sql Datetime query into Linq
- How can I convert a colum of DATETIME type to string with linq
- How can i convert Char to Datetime in Linq Where clause
- how to convert string to datetime in Linq where clause
- How to Convert DateTime to string in linq query c#
- How to convert string to datetime and then get the lowest date
- How to get all the properties of items in List and convert them to a GridColumn using LINQ?
- How to convert string Date to DateTime when you are selecting record through LINQ?
- How to convert data in sql table into datetime and compare with other value in linq
- How to merge a list of lists with same type of items to a single list of items?
- How to convert linq results to HashSet or HashedSet
- How to get duplicate items from a list using LINQ?
- How to check if all list items have the same value and return it, or return an “otherValue” if they don’t?
- ASP.NET MVC How to convert ModelState errors to json
- C#: How to convert a list of objects to a list of a single property of that object?
More Query from same tag
- Trying to get a random sort order
- Update Linq query selecting from two tables?
- How to sort and output data stored in a list
- LINQ Query - exclude the values of one list from another list
- Inserting an [Order] and [OrderItems] in LINQ
- How does LINQ expression syntax work with Include() for eager loading
- view model returning list of data in linq
- What are the roles of IEqualityComparer and IEquatable in the Enumerable.SequenceEqual method
- Using Select and Where in a List using LINQ statement
- Linq IN statement to exclude from a list
- Efficient way to get a huge number of records sorted via Linq. Also some help regarding editing an existing DB entry
- LINQ not returning desired data
- How improve add items under the List, when i have more than 2 elements
- IQueryable WHERE inside a for loop does not produce expected result
- Fill missing weeks in linq result to 0
- What is the underlying type of the result from a Linq to Entities query?
- linq joining tables error
- Subtract dates in Linq EF6
- entity framework - underlying SQL statement
- LINQ Right Join
- LINQ: How to Append List of Elements Into Another List
- C# LINQ select until amount >= 0
- Read element from SOAP message
- LINQ GroupBy continuous time
- Nested lists, how I can do this with lambda expression?
- Transpose a Custom Collection with Linq
- parsing xml and my code got ugly, any more elegant way to do this?
- Convert IEnumerable<int[][]> to int[][]
- How to filter result by a specific value on one field OR a list of values on another field
- LINQ query for XML with difficult struct