![]() |
|
|
|||||||
| Petri.co.il is happy to award auglan the title of Most Valuable Member !!! |
| Register | Calendar |
Search |
Today's Posts |
Mark Forums Read |
| Notices |
|
|
How do I populate mysql field with textbox stringthis thread has 3 replies and has been viewed 4338 times
|
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||||||||
|
|||||||||
|
Howdy all....
I still have my stablisers on as far as vb.net and mysql are concerned. What I am trying to do is populate a status field within mysql with the content from a textbox in vb.net. I have my link working as I have populated a combo box from the same table but I cant work out how to do it the other way. Answers on a postcard or preferably in a box below. Thanks loads |
|
#2
|
|||||||||
|
|||||||||
|
Just to elaborate on this a little. I have a combo box which populates from a mysql table. I then populate a textbox with "some text" from a button. Then what I am trying to do is populate the relative field "status" for the selected name from the combo box within the mysql db.
Confused? Sorry |
|
#3
|
||||||||||
|
||||||||||
|
So you get data from the database to populate the combo box, but want to save the text entered on the form to the database?
Where you use a SELECT to fetch data, use INSERT or UPDATE as appropriate to write back.
__________________
Gareth Howells BSc (Hons), MBCS, MCP, MCDST, ICCE Any advice is given in good faith and without warranty. Please give reputation points if somebody has helped you. "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb. "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three. |
|
#4
|
|||||||||
|
|||||||||
|
Thanks I do get that, the problem occurs when I am trying to change the code to achieve the INSERT. Here is my get code:
Dim sStmt As String = "SELECT CONCAT (firstname, "" "", surname) AS FullName FROM phonebook" Dim da As New MySqlDataAdapter(sStmt, con) Dim dt As New DataTable("table") da.Fill(dt) If dt.Rows.Count > 0 Then ComboBox1.DisplayMember = "FullName" ComboBox1.DataSource = dt End If Am I correct in thinking the Dim da As New MySqlDataAdapter(sStmt, con) handles the actual data? After that I am stuck as to how to tell the code to write to the specific field based on the result of the combo box? Appreciate your patience - Im not the quickest when it comes to vb.net & mysql |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pre populate Fields address tab | mhoogev | SBS 2008 / 2011 | 0 | 23rd December 2009 14:58 |
| How do I query and import data in a textbox into a datagridview VB VS 08 | JenniferBarman | General Scripting | 0 | 7th September 2009 02:54 |
| CheckBox enables Textbox | aflamal | Outlook XP/2003/2007 | 2 | 22nd November 2007 13:38 |
| Auto populate server name when clicking check name | m80arm | Exchange 2000 / 2003 | 0 | 1st September 2006 12:07 |
| Outlook 2000 auto-populate | shizrah | Outlook XP/2003/2007 | 1 | 23rd February 2006 10:20 |