HI guys how can i insert todays date in my query,my query is as follows:

myString = @"INSERT INTO wordTbl(word,text,date)  Values('" + (string)row["word"] + "','"+richTextBox1.Text+"','"+DateTime.Now.ToString()+"')";

can i store this in a variable and then i ll be able to pass it in query

Why don't you tell us what you're trying to do and we can tell you how to go about it. You must have to post your problem here.

Take a timer contor,label on your form & write following code on timer

label1.Text = DateTime.Noe.ToString();
It cna store and display the current date time.

sorry for any misunderstanding guys.What i am trying to do is to add a word ina databse and the date that word was added to database. I am trying to write a query to input the word and current date with it.my query looks like this...

myString = @"INSERT INTO wordTbl(word,text,date)  Values('" + (string)row["word"] + "','"+richTextBox1.Text+"','"+DateTime.Now.ToString()+"')";
myString = @"INSERT INTO wordTbl(word,text,date)  Values('" + (string)row["word"] + "','"+richTextBox1.Text+"','"+DateTime.Now.ToString("yyyyMMdd hh:mm:ss:fff")+"')";
This question has already been answered. Start a new discussion instead.