c# and Access
Posted on 2015-02-20
Can someone please tell me how to save a date into an access database?
Let me explain;
I have a table within an access database. In one table I have a Field "DateofDefect" with data-type of "Date/Time".
In my c# application I have the current date being displayed in a label. How do I save that date into this access database?
here are snips of my code;
label1.Text = DateTime.Today.ToLongDateString();
command.CommandText = "Insert into GlassDefectData (Line, Shift, AreaofConcern, GlassDefect, DateofDefect) values ('"+label9.Text+"','"+label13.Text+"','"+label10.Text+"','"+label11.Text+"','"+label1.Text+"' )";