Hi guys
Im trying to save a combobox selected item to my database but i cant get it working, it saves "user" instead of the username that is stored in the combobox, any suggestions? here's a snippett
Try
'----------------Sends the message-------------------------------------------------------------------
MysqlConn.Open() ' opening the connection to the DB
Dim query As String
Dim thanks As String = "Thanks "
Dim thankUser As String = cboUsers.SelectedItem.ToString() 'was originally DisplayMember.tostring
Dim ThankYou As String = thanks + thankUser
query = "insert into dojodb.chats (Sender, Message) values ('" & lblUser.Text & "','" & ThankYou & "')"
command = New MySqlCommand(query, MysqlConn)
reader = command.ExecuteReader 'executes the command and reads data from db
reader.Close()
'-----------------End send--------------------------------------------------------------------------