0

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()+"')";
6
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by sdhawan
0

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

0

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.

0

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.

0

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()+"')";
0
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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.