how is run
-
i am using date concept.i get system date.but i host the project in website.it will be run.i am using the query select * from tablename where date='"+systemdate+"'.i have one dought i donot open website,how it's run.it will run or not.if you know the answer replay to me..
-
i am using date concept.i get system date.but i host the project in website.it will be run.i am using the query select * from tablename where date='"+systemdate+"'.i have one dought i donot open website,how it's run.it will run or not.if you know the answer replay to me..
-
Can you write your question in somewhat better manner. It is not at all clear what you want to ask.
Apurva Kaushal
i am using ---> string month, yearr, datee, systemdate; month = DateTime.Now.Month.ToString(); yearr = DateTime.Now.Year.ToString(); datee = DateTime.Now.Day.ToString(); systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString()); SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;"); con.Open(); SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con); cmd.ExecuteNonQuery(); con.Close(); this is my code. systemdate reach the date it will be delete.but i host the project in web.how it is work? replay to me...
-
i am using date concept.i get system date.but i host the project in website.it will be run.i am using the query select * from tablename where date='"+systemdate+"'.i have one dought i donot open website,how it's run.it will run or not.if you know the answer replay to me..
Completely agree. Please, the English language has tools for letting people understand each other. Anyhow, maybe you should consider changing the query and use the DB server date, something like SELECT * FROM tablename WHERE date = GETDATE() [if on SQL Server].
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
-
Completely agree. Please, the English language has tools for letting people understand each other. Anyhow, maybe you should consider changing the query and use the DB server date, something like SELECT * FROM tablename WHERE date = GETDATE() [if on SQL Server].
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
we are not opening the website.ok how to get system date ..do u get my point.
-
we are not opening the website.ok how to get system date ..do u get my point.
sugunavathysubramanian wrote:
we are not opening the website.ok how to get system date ..do u get my point.
How do you expect the code to be executed if the website isn't running? You do understand how websites, the internet and the HTTP protocol works, don't you?
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
we are not opening the website.ok how to get system date ..do u get my point.
No idea about what you really mean with 'not opening the website' :confused:, but anyhow, in the code you posted before...
string month, yearr, datee, systemdate;
month = DateTime.Now.Month.ToString();
yearr = DateTime.Now.Year.ToString();
datee = DateTime.Now.Day.ToString();systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString());
SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;");
con.Open();
SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con);
cmd.ExecuteNonQuery();
con.Close()What about...
SqlCommand cmd = new SqlCommand("delete from no where date= GETDATE()", con)
That's what I originally meant.
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
-
i am using ---> string month, yearr, datee, systemdate; month = DateTime.Now.Month.ToString(); yearr = DateTime.Now.Year.ToString(); datee = DateTime.Now.Day.ToString(); systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString()); SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;"); con.Open(); SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con); cmd.ExecuteNonQuery(); con.Close(); this is my code. systemdate reach the date it will be delete.but i host the project in web.how it is work? replay to me...
sugunavathysubramanian wrote:
string month, yearr, datee, systemdate; month = DateTime.Now.Month.ToString(); yearr = DateTime.Now.Year.ToString(); datee = DateTime.Now.Day.ToString(); systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString()); SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;"); con.Open(); SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con); cmd.ExecuteNonQuery(); con.Close();
X| Buy a basic programming book, there are so much chaff in the above that it is impossible to guide you. eg. Convert.ToString(yearr.ToString()); <-- anything strike you as redundant in this snippet?
-
i am using date concept.i get system date.but i host the project in website.it will be run.i am using the query select * from tablename where date='"+systemdate+"'.i have one dought i donot open website,how it's run.it will run or not.if you know the answer replay to me..
I would suggest you two things: 1) Prefer stored procedures instead of such queries. 2) Use Google first. These are little queries that Google can help you in a jiffy without having to wait for some one to respond and assist you through.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson -
i am using ---> string month, yearr, datee, systemdate; month = DateTime.Now.Month.ToString(); yearr = DateTime.Now.Year.ToString(); datee = DateTime.Now.Day.ToString(); systemdate = Convert.ToString(month.ToString()) + "/" + Convert.ToString(datee.ToString()) + "/" + Convert.ToString(yearr.ToString()); SqlConnection con = new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;"); con.Open(); SqlCommand cmd = new SqlCommand("delete from no where date='" + systemdate + "'", con); cmd.ExecuteNonQuery(); con.Close(); this is my code. systemdate reach the date it will be delete.but i host the project in web.how it is work? replay to me...
sugunavathysubramanian wrote:
new SqlConnection("server=.;initial catalog=master;user id=sa;password=sa;");
Your database administrator should really be kicked with a wet towel till he understands the folly he has created: 1) Allowing others to tamper the master database 2) Having a weak password for sa account.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson