Danish Habib

Danish Habib

  • NA
  • 694
  • 244.3k

SQL Query working with C Sharp for sqlite does not work

Oct 21 2015 9:45 AM
I have a desktop application in which i have used c sharp with SQL server the below query fetches the data from the database when i am using the sql server as database but when i used sqlite database the below query does return nothing . 
tell me is there any different in writing inline queries in c sharp for sql and sqlite , or does the MAX or like function works differently in SQL and SQLITE below is my query
com.CommandText = "SELECT MAX(DocumentCode) AS DocumentCode FROM DocumentsHeader WHERE (DocumentCode LIKE @DocumentCode + '%')";
com.Parameters.Add("@DocumentCode", SqlDbType.NVarChar, 18).Value = Passvalue.ToString().Trim();
returnvalue = com.ExecuteScalar();
This query fetches record when using sql and when using sqlite it does nt fetching record while i check that my Db has the record .
any one can assists me ...