I have been researching on how to insert a date into my mySql database using the visual studio. I understand the error that mySql only accepts a certain format and I've been browsing both the net and other similar topics about this here on stackoverflow... but almost all the examples have the date as a pre-made string that is changed using the parseexact conversion
It looks something like this:
result = DateTime.ParseExact(nowstring, format, provider)
But the thing is I'm trying this with a dateTime.now function. I want a realtime dateTime added to the database each time my program does something.. well from what I researched, it should look something like this..
string nowstring, format;
                DateTime result;
                System.Globalization.CultureInfo provider = System.Globalization.CultureInfo.InvariantCulture;
                format = "yyyy-MM-dd";
                nowstring = DateTime.Now.ToString();
                result = DateTime.ParseExact(nowstring, format, provider);
I guess I'm just doing something wrong since we havent tackled this at school yet or im just simply missing something elementary. Either way, I'd glady appreciate your help.