|
-
Dec 2nd, 2005, 02:37 PM
#1
Thread Starter
Member
Query Strings - RESOLVED
I am coming from a vb6 background so I am new to .net. I am trying to add the value of a combobox in my sql and I use to go
select * from tbl where id = '" & combobox.text & "'"
I tried doing this and it states:
Error 4 Operator '&' is not defined for types 'String' and 'System.Windows.Forms.ComboBox'. C:\Documents and Settings\sodam\My Documents\Visual Studio 2005\Projects\SC_Utility\SC_Utility\frmMain.vb 87 43 SC_Utility
Thanks for your help
Shannon
Last edited by odamsr; Dec 2nd, 2005 at 02:58 PM.
Reason: Resolved
-
Dec 2nd, 2005, 02:40 PM
#2
Re: Query Strings
That code should work - but are you calling it EXACTLY Like that though? Because if you are, ComboBox is a type, not an instance of a combobox. usually you'd see something more like..
VB Code:
select * from tbl where id = '" & combobox[b]1[/b].text & "'"
Bill
-
Dec 2nd, 2005, 02:56 PM
#3
Re: Query Strings
That's the problem. You are attempting to concatenate a string and an object type, which doesn't work.
My usual boring signature: Nothing
 
-
Dec 2nd, 2005, 02:57 PM
#4
Thread Starter
Member
Re: Query Strings
Thanks. I made a stupid mistake. Forgot to use combobox.text. I just used me.cbobox
Thanks
Shannon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|