473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

What's wrong in my select statement

25
Hi everybody,

Could anyone help me in the select statement. I created small form to search in the database, it gaves me an error Missing Expression. The combox has the attributes of the table because I want restrict the search to only on specfic columns.

Expand|Select|Wrap|Line Numbers
  1. commandString = "Select * from tableadd where " + this.comboBox1.SelectedText + "like '%" + textBox1.Text + "%'" + "AND" + this.comboBox2.SelectedText + "like '%" + textBox1.Text + "%'";

Thanks in advance
Mar 9 '12 #1
1 1575
Rabbit
12,516 Expert Mod 8TB
Output the SQL string and you will see what's wrong. Here's a hint, your spacing is off.
Mar 9 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: winderjj | last post by:
Hi, I am receiving an error when running a stored procedure with the following select statement: SELECT count(pass_num) INTO count FROM eco_class_t; The first time I run the procedure...
1
by: avinash | last post by:
hi myself avi i am developing one appliacaion in which i am using vb 6 as front end, adodb as database library and sql sever 7 as backend. i want to update one table for which i required data from...
1
by: John Hall | last post by:
We need to read a SQL database containing a mix of English words and Chinese Characters. We think we need to use the N'xxxx' to read the Unicode. We have one place where the SELECT statement...
3
by: Omar | last post by:
Hi, In the next sentence, what's wrong? <select name='id' onChange="window.location='dePaso.jsp?vuelta=a&nombre=id&anterior=ejecutivo = 'Daniel Perez'&valor='+this.options.value"> IE...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
8
by: Brian Basquille | last post by:
Hello all, Bit of a change of pace now. As opposed to the typical questions regarding my Air Hockey game, am also working on a Photo Album which uses an Access Database to store information...
2
by: Beowulf | last post by:
If I run this statement in Query Analyzer, it properly returns 1 for my testing table. But if I put the statement into a stored procedure, the stored procedure returns NULL. What am I doing...
11
by: pamelafluente | last post by:
Hi I am executing some simple sample code: Using OleDbCommand As New OleDbCommand(Me.DBQuery.Text, Me.OleDbConnection) Dim OleDbParameter As OleDbParameter =...
1
by: mycall | last post by:
Heyyas. I am trying to print out a report which lists account details and payment amounts from january to december. I have following tables: Payment(paymentNo, DateOwing, amount, accountID)...
2
by: Rahul Babbar | last post by:
Hi, I am facing some issues with the following set of commands. The last 'Select' statement gives the error "SQL0511N The FOR UPDATE clause is not allowed because the table specified by the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.