Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

Text from database into text box on web.

  • Please log in to reply




  • Member
  • PipPip
  • 29 posts
Anyone know how to get text in a record in a database to copy+paste into a text box on a webpage using visual basic, like the one i typed in to type this post?
I need it to upload customer addresses into my server through a form on the websites control panel :<
Really boring stuff if i do it manually.

I can do the majority of the script myself, i just have no idea how i would get text to copy into a text box in a browser.

Edited by Welshhobo, 06 August 2010 - 08:48 AM.

  • 0





  • Member
  • PipPipPip
  • 170 posts
I had a similar program I wrote not too long ago. My solution was... tacky, to make an understatement, but I'll describe it and you can see if you're interested. I used C#, but you should be able to migrate my approach over to visual basic pretty easily.
What I did was, I made a browser window inside the GUI that would open up, by default, to the page where the information was to be entered. Once all the data was ready and the user was on the correct page, they would click a button in the GUI. They would then have something like 10 seconds to click on the little "text box," if you will, in the browser window, where the program was to enter the data. After waiting for 10 seconds, the program would call the System.Windows.Forms.SendKeys method, which effectively just emulates keyboard input, to perform the data entry.

If you don't want to make a GUI with a browser window inside of it, you could just as easily apply this method to a regular browser window that the user already has open. You could even make my program type something into Notepad without changing anything. The only catch is, it's up to the user to see that, when the time comes, the emulated keyboard input goes to the right place.
However, I must warn you, I could NOT, for the life of me, figure out how to make the program work without using a System.Windows.Forms.Timer, which of course necessitates the use of a GUI to some degree. Any approach I tried that did NOT use a Timer (and I tried a great many, even going into some pretty advanced stuff with threading), would cause the program to hang during the 10 second delay.

If you like this idea, read up on the following topics:
Windows Forms Programming (using MS Visual Basic of course)
Events Programming (required to make proper use of the timer)

Based on the confidence you had in your post, I don't think it will take you long at all to learn everything you need by looking those things up. If I'm wrong, though, just reply and let me know where specifically you need help in using this approach :)
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP