DateTime
int index = Reader.GetOrdinal("CreationDateTime"); DateTime? creationDateTime = Reader.IsDBNull(index) ? null : Reader.GetDateTime(index);
string strConnect = SMDBSupport.SMInstanceStorage.GetInstanceConnectionString("Testing"); using (SqlConnection con = new SqlConnection(strConnect)) { try { con.Open(); using (SqlDataAdapter da = new SqlDataAdapter("Select * from Table_3", con)) { using (DataTable dt = new DataTable()) { da.Fill(dt); myDataGridView.DataSource = dt; myDataGridView.ClearSelection(); myDataGridView.Columns[1].DefaultCellStyle.Format = "yyyy-MM-dd hh:mm:ss.fffffff"; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)