Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how is run

how is run

Scheduled Pinned Locked Moved ASP.NET
database
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sugunavathysubramanian
    wrote on last edited by
    #1

    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..

    _ A V 3 Replies Last reply
    0
    • S sugunavathysubramanian

      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..

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      Can you write your question in somewhat better manner. It is not at all clear what you want to ask.

      Apurva Kaushal

      S 1 Reply Last reply
      0
      • _ _AK_

        Can you write your question in somewhat better manner. It is not at all clear what you want to ask.

        Apurva Kaushal

        S Offline
        S Offline
        sugunavathysubramanian
        wrote on last edited by
        #3

        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...

        J V 2 Replies Last reply
        0
        • S sugunavathysubramanian

          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..

          A Offline
          A Offline
          Ariel Kazeed
          wrote on last edited by
          #4

          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."

          S 1 Reply Last reply
          0
          • A Ariel Kazeed

            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."

            S Offline
            S Offline
            sugunavathysubramanian
            wrote on last edited by
            #5

            we are not opening the website.ok how to get system date ..do u get my point.

            P A 2 Replies Last reply
            0
            • S sugunavathysubramanian

              we are not opening the website.ok how to get system date ..do u get my point.

              P Offline
              P Offline
              pmarfleet
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • S sugunavathysubramanian

                we are not opening the website.ok how to get system date ..do u get my point.

                A Offline
                A Offline
                Ariel Kazeed
                wrote on last edited by
                #7

                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."

                1 Reply Last reply
                0
                • S sugunavathysubramanian

                  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...

                  J Offline
                  J Offline
                  J4amieC
                  wrote on last edited by
                  #8

                  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?

                  1 Reply Last reply
                  0
                  • S sugunavathysubramanian

                    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..

                    V Offline
                    V Offline
                    Vasudevan Deepak Kumar
                    wrote on last edited by
                    #9

                    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

                    1 Reply Last reply
                    0
                    • S sugunavathysubramanian

                      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...

                      V Offline
                      V Offline
                      Vasudevan Deepak Kumar
                      wrote on last edited by
                      #10

                      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

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups