Try as given below:
while (MyReader.Read())
{
TextBox1.Text = Convert.ToDateTime(MyReader["DateField"]).ToString("dd/MM/yyyy");
}
in ToString()
method you can change data format as per your requirement.
More Related Contents:
- ExecuteReader requires an open and available Connection. The connection’s current state is Connecting
- MetadataException: Unable to load the specified metadata resource
- Get output parameter value in ADO.NET
- When should “SqlDbType” and “size” be used when adding SqlCommand Parameters?
- SQLite Database Locked exception
- Is it necessary to manually close and dispose of SqlDataReader?
- Populate data table from data reader
- When using Trusted_Connection=true and SQL Server authentication, will this affect performance?
- Difference with Parameters.Add and Parameters.AddWithValue
- SqlConnection SqlCommand SqlDataReader IDisposable
- Exception when AddWithValue parameter is NULL
- Calling Oracle stored procedure from C#?
- Insert into C# with SQLCommand
- MultipleActiveResultSets=True or multiple connections?
- How to pass a table-value parameter
- How to fill Dataset with multiple tables?
- How DataReader works?
- How to keep single SQL Server connection instance open for multiple request in C#?
- DataTable equivalent in Java [duplicate]
- How do I re-write a SQL query as a parameterized query?
- Multiples Table in DataReader
- Check if a SQL table exists
- What is the difference between dataview and datatable?
- What ‘length’ parameter should I pass to SqlDataReader.GetBytes()
- How do I connect to a SQL database from C#?
- .net connection pooling
- Do we have transactions in MS-Access?
- Random Gaussian Variables
- File.Delete failing when Image.FromFile was called prior it, despite making copy of loaded image and destroying original one
- .NET Core include folder in publish