Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ComboBox.Text

Author  Topic 

EricBHK
Starting Member

18 Posts

Posted - 2012-08-16 : 01:43:52
I have hard coded a value to delete through a sql script as follows :

CopySql10 = "DELETE FROM Keywords02 WHERE Keyword = 'Aalst' "

and this is working fine. However, I now want to replace the hard coded value 'Aalst' by the selection made in a ComboBox (in the same WinForm (VS 2010) as follows :

CopySql10 = "DELETE FROM Keywords02 WHERE Keyword = " & ComboBox1.Text & ";"

I keep getting parameters error. Any idea(s) on what I am doing wrong here ?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-08-16 : 01:57:30
[code]Keyword = '" & ComboBox1.Text & "';"[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

EricBHK
Starting Member

18 Posts

Posted - 2012-08-16 : 02:00:48
Works like a charm. Thanks a lot !
I spent hours on Google without proper sample code.
Go to Top of Page
   

- Advertisement -