1

When i am trying to execute select query not executing .

after the below line of code execution of program stopped.

NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din =? ",din];
2
  • provide few more lines of code. Commented May 22, 2012 at 6:46
  • Please do not CLCIK the "UP/DOWN" arrows just for fun, OR at least study the stackoverflow to find out that when & how to use them? what special thing in this question forced you to give it +1?? Commented May 22, 2012 at 6:50

2 Answers 2

5

if din is integer then,

NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din =%d ",din];

and if din is string then,

NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din ='%@' ",din];
Sign up to request clarification or add additional context in comments.

Comments

0

Din must me an nsstring, what is the object type of din

if it is int, please wrap it in an NSString

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.