Sign in to follow this  
Rebel Coder

ASP.NET with VB. I need help

Recommended Posts

So my teacher gave us this awesome project where we have to data bind the information the user enters on a textbox and selects on a drop down list at the click of a button. He gave us this video which showed us how to get the database set up with the table easy peasy, then when it came to the button coding part, the guy in the video was using C# and I need to do it in VB -___-, I've been looking around and no one can give me a clear answer. So how do I make it so when I click the button it saves the info on a textbox to my table and a dropdownlist selection. If anyone can tell me I'd really appreciate it.

Share this post


Link to post
Share on other sites
When the onlick event happens insert the text field inside the textbox object into an SQL stringbuffer.
With the dropdown, using the nth selectedindex value look up the nth value inside the items collection.
Then insert that value into the SQL stringbuffer.

[url="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.dropdownlist.aspx"]http://msdn.microsof...opdownlist.aspx[/url]
[url="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.textbox.aspx"]http://msdn.microsof...ox.textbox.aspx[/url]
[url="http://forums.asp.net/t/1042463.aspx/1"]http://forums.asp.net/t/1042463.aspx/1[/url]
[url="http://www.yaldex.com/vb-net-tutorial-2/library.books24x7.com/book/id_5526/viewer.asp@bookid=5526&chunkid=0225724381.htm"]http://www.yaldex.com/vb-net-tutorial-2/library.books24x7.com/book/id_5526/viewer.asp@bookid=5526&chunkid=0225724381.htm[/url]

For databinding you will need to update the SQL buffer for every onTextChange(The textbox), or onSelect(The dropdown).
This is automatic when you bind the control to the DB. Look at last couple links I included, they cover this. Edited by kd7tck

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this