Resolved why is date from table not displaying properly

rowlandsfc

Active member
Joined
Feb 3, 2019
Messages
43
Location
bridgend
Programming Experience
Beginner
i have a datagrid view that displays the information in a table, there is a created row which stores dates how ever when the information is loaded into the datagridview only the first number is displayed, currently the format of the date is yyyy-MM-dd, if you change the format to say dd-MM-yyyy then only the dd will be displayed, the database was given as part of my project and i manually created the create column and entered dates using db browser, ive tried date formats that match windows forms exactly but still the same issue.

code to select the table data and fill datagridview:
connAccount = new SQLiteConnection(dbConnection.source);

                    cmd.CommandText = @"SELECT accid, account.custid, customer.title, customer.firstname || ' ' || customer.lastname AS Name, product.isaname AS ProductName,product.intrate, balance, accrued, active, created FROM account INNER JOIN customer ON customer.custid = account.custid INNER JOIN product ON product.prodid = account.prodid";


                    da_Accounts = new SQLiteDataAdapter(cmd.CommandText, connAccount);
                    dt_Accounts = new DataTable();
                    da_Accounts.Fill(dt_Accounts);
                    dgv_Account.DataSource = dt_Accounts;

executing the sql code in db browser brings up the date as it is shown in the table
 

Latest posts

Back
Top Bottom