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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. executing code in a textbox on runtime

executing code in a textbox on runtime

Scheduled Pinned Locked Moved C#
12 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.
  • R Rajesh R Subramanian

    WinSolution wrote:

    i can explain it well anyway if any body want to discuss i am available

    Explaining it clearly at the first place didn't look like a good idea to you?

    It is a crappy thing, but it's life -^ Carlo Pallini

    W Offline
    W Offline
    WinSolution
    wrote on last edited by
    #3

    Dear I have explained my problem as best as i can. I was meant to say that i was able to explain better if there was a support of pasting image Rajesh : did you start reading my post from bottom :-D

    M 1 Reply Last reply
    0
    • W WinSolution

      Dear I have explained my problem as best as i can. I was meant to say that i was able to explain better if there was a support of pasting image Rajesh : did you start reading my post from bottom :-D

      M Offline
      M Offline
      molesworth
      wrote on last edited by
      #4

      WinSolution wrote:

      I have explained my problem as best as i can.

      Unfortunately not well enough for us to understand exactly what it is you are trying to do. I'm wondering whether you're trying to run Excel in your app, or convert information from Excel to C# code, which you want to compile and run. Or perhaps something else...

      WinSolution wrote:

      I was meant to say that i was able to explain better if there was a support of pasting image

      There are several free image hosting sites where you can upload your images and provide links to them.

      There are three kinds of people in the world - those who can count and those who can't...

      W 1 Reply Last reply
      0
      • W WinSolution

        I am creating a project it contains two textbox. In first TextBox i paste text from an excel sheet. On click of button it generates some code set it to text property of Second TextBox. currently i compile & excute project, generate code and then i paste to my project and then again i compile & execute project again to run this code. As i can't past the screen shot of that here else i can explain it well anyway if any body want to discuss i am available

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #5

        This article might help: Convert MP3 to EXE[^]

        Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion

        1 Reply Last reply
        0
        • W WinSolution

          I am creating a project it contains two textbox. In first TextBox i paste text from an excel sheet. On click of button it generates some code set it to text property of Second TextBox. currently i compile & excute project, generate code and then i paste to my project and then again i compile & execute project again to run this code. As i can't past the screen shot of that here else i can explain it well anyway if any body want to discuss i am available

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #6

          Do you want to automatically compile and run the text you outputted to your second textbox? That's entirely possible, but before I look up an article about runtime compilation for you I'd like to know whether this was really what you had in mind..

          W 1 Reply Last reply
          0
          • M molesworth

            WinSolution wrote:

            I have explained my problem as best as i can.

            Unfortunately not well enough for us to understand exactly what it is you are trying to do. I'm wondering whether you're trying to run Excel in your app, or convert information from Excel to C# code, which you want to compile and run. Or perhaps something else...

            WinSolution wrote:

            I was meant to say that i was able to explain better if there was a support of pasting image

            There are several free image hosting sites where you can upload your images and provide links to them.

            There are three kinds of people in the world - those who can count and those who can't...

            W Offline
            W Offline
            WinSolution
            wrote on last edited by
            #7

            I am working in an organization in which i update the record to a central tracker. Mostly data provided to me is in Excel. I pick the data from excel paste it into first TextBox. Data cosist of Two Columns as mentioned below ________________________ Site ID | DN Received | ------------------------ MDWH2813 | 10-May-08 | MDWH2814 | 10-May-08 | MDWH2739 | 10-May-08 | ------------------------ i will copy data excluding the header area from the upper section and paste it into 1st textbox that looks like as follow MDWH2813 10-May-08 MDWH2814 10-May-08 MDWH2739 10-May-08 Then i click on a button and i generates a C# code as under and set as text on 2nd TextBox updateCentralTracker("MDWH2813","10-May-08"); updateCentralTracker("MDWH2814","10-May-08"); updateCentralTracker("MDWH2739","10-May-08"); currently i copy the generated code from 2nd TextBox. copy it to my solution and rebuild & execute and then i click on the second button that executes the code and data is updated to the Central Tracker. but i want when i generate the code on first run then i click on the second button and it should run that code at run time i hope its now understandable let me know if any query

            S 1 Reply Last reply
            0
            • L Lost User

              Do you want to automatically compile and run the text you outputted to your second textbox? That's entirely possible, but before I look up an article about runtime compilation for you I'd like to know whether this was really what you had in mind..

              W Offline
              W Offline
              WinSolution
              wrote on last edited by
              #8

              Yes you are right i dont want to compile but only execute. but pasting it at desired place where currently i paste it manually ignore the last line if you are not able to understand its about sequence/placement of auto. generated code.

              L M 2 Replies Last reply
              0
              • W WinSolution

                Yes you are right i dont want to compile but only execute. but pasting it at desired place where currently i paste it manually ignore the last line if you are not able to understand its about sequence/placement of auto. generated code.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #9

                Well you can't execute without compiling, but you can compile and run at runtime[^]

                1 Reply Last reply
                0
                • W WinSolution

                  Yes you are right i dont want to compile but only execute. but pasting it at desired place where currently i paste it manually ignore the last line if you are not able to understand its about sequence/placement of auto. generated code.

                  M Offline
                  M Offline
                  molesworth
                  wrote on last edited by
                  #10

                  WinSolution wrote:

                  Then i click on a button and i generates a C# code as under and set as text on 2nd TextBox updateCentralTracker("MDWH2813","10-May-08"); updateCentralTracker("MDWH2814","10-May-08"); updateCentralTracker("MDWH2739","10-May-08"); currently i copy the generated code from 2nd TextBox. copy it to my solution and rebuild & execute and then i click on the second button that executes the code and data is updated to the Central Tracker. but i want when i generate the code on first run then i click on the second button and it should run that code at run time

                  Is it not possible to use the information from the text box directly? Something like "updateCentralTracker(string1, string2);"? Is there some reason you have to create explicit string constants for the parameters?

                  There are three kinds of people in the world - those who can count and those who can't...

                  W 1 Reply Last reply
                  0
                  • W WinSolution

                    I am working in an organization in which i update the record to a central tracker. Mostly data provided to me is in Excel. I pick the data from excel paste it into first TextBox. Data cosist of Two Columns as mentioned below ________________________ Site ID | DN Received | ------------------------ MDWH2813 | 10-May-08 | MDWH2814 | 10-May-08 | MDWH2739 | 10-May-08 | ------------------------ i will copy data excluding the header area from the upper section and paste it into 1st textbox that looks like as follow MDWH2813 10-May-08 MDWH2814 10-May-08 MDWH2739 10-May-08 Then i click on a button and i generates a C# code as under and set as text on 2nd TextBox updateCentralTracker("MDWH2813","10-May-08"); updateCentralTracker("MDWH2814","10-May-08"); updateCentralTracker("MDWH2739","10-May-08"); currently i copy the generated code from 2nd TextBox. copy it to my solution and rebuild & execute and then i click on the second button that executes the code and data is updated to the Central Tracker. but i want when i generate the code on first run then i click on the second button and it should run that code at run time i hope its now understandable let me know if any query

                    S Offline
                    S Offline
                    Searril
                    wrote on last edited by
                    #11

                    Instead of trying to recompile on the fly, why don't you just parse the data you are already pasting into the box and issue your command to upload...all in one step? Maybe I am missing the point but it looks like you are trying to make a simple solution as difficult as possible.

                    1 Reply Last reply
                    0
                    • M molesworth

                      WinSolution wrote:

                      Then i click on a button and i generates a C# code as under and set as text on 2nd TextBox updateCentralTracker("MDWH2813","10-May-08"); updateCentralTracker("MDWH2814","10-May-08"); updateCentralTracker("MDWH2739","10-May-08"); currently i copy the generated code from 2nd TextBox. copy it to my solution and rebuild & execute and then i click on the second button that executes the code and data is updated to the Central Tracker. but i want when i generate the code on first run then i click on the second button and it should run that code at run time

                      Is it not possible to use the information from the text box directly? Something like "updateCentralTracker(string1, string2);"? Is there some reason you have to create explicit string constants for the parameters?

                      There are three kinds of people in the world - those who can count and those who can't...

                      W Offline
                      W Offline
                      WinSolution
                      wrote on last edited by
                      #12

                      Thanks for your valuable contribution. both (Searril & molesworth ) Yes that is possible but as this data is going to be update in central tracker and is copy pasted from excel file and there are chances that it can break my algorithm in some conditions when data is not provided to me in expected format. so i want to confirm it once time by watching it. another point ; i am generating code to avoid loop in case i don't generate code i have to go through each line and apply my algo on it and then to send update to tracker and i cannot also verify it visually. so it will be best solution to the problem if i can rum my code at runtime in my opinion else there are 101 way to do it.

                      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