Click here to Skip to main content
16,004,587 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This below query is not correctly working with sqlite weather with sql it works fine i am using vb.net


SQL
com.CommandText = "SELECT MAX(DocumentCode) AS DocumentCode FROM DocumentsHeader WHERE (DocumentCode LIKE @DocumentCode + '%')";
com.Parameters.Add("@DocumentCode", SqlDbType.NVarChar).Value = Passvalue.ToString().Trim();
returnvalue = com.ExecuteScalar();
Posted
Comments
Richard MacCutchan 20-Oct-15 16:05pm    
What does "is not correctly working" mean?
Malikdanish 20-Oct-15 16:14pm    
My Database is having the record which is matched with wildcard % and it works fine but when i am woring with sqlite it does nt fetch the record from the db , I mean to say that This query works fine with SQL but with SQLITE it is not . about DB both DB Having 100 % same entries and same schema of DB as well

Refer to this good article, http://www.techonthenet.com/sqlite/like.php[^]

It may be that you need single quotes around your DOcumentCode. What datatype is DocumentCode?
 
Share this answer
 
Comments
Malikdanish 21-Oct-15 0:46am    
It is of type nvarchar(255)
This question is a duplicate of sqlite query syntax error with like operator[^]. Please do not post the same question more than once.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900