Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:34:34+00:00 2026-06-03T06:34:34+00:00

I stored the image as BLOB in database and i fetched it using the

  • 0

I stored the image as BLOB in database and i fetched it using the following coding

const char*dbPath=[databasePath UTF8String];
if (sqlite3_open(dbPath, &sqliteHandler)==SQLITE_OK) {
    sqlite3_stmt *stmt;
    NSString *selctQuery=[NSString stringWithFormat:@"select * from imagetable where imageId=11"];
    NSLog(@"selectQuery is %@",selctQuery);
    const char *dispStmt=[selctQuery UTF8String];       
    sqlite3_prepare_v2(sqliteHandler, dispStmt, -1, &stmt, NULL);
    NSLog(@"%d",sqlite3_prepare_v2(sqliteHandler, dispStmt, -1, &stmt, NULL));

    while (sqlite3_step(stmt)==SQLITE_ROW) {
        //  NSString *pwd=[[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(sqltmt, 1)];
    //  NSString *image1=[[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(stmt, 1)];
    //  NSString *image2=[[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(stmt, 2)];
    //  NSString *image3=[[NSString alloc]initWithUTF8String:(const char *)sqlite3_column_text(stmt, 3)];
        //NSLog(@"%@",image1);
        NSData *cachedImage1 = [[NSData alloc] initWithBytes:sqlite3_column_blob(stmt, 1) length: sqlite3_column_bytes(stmt, 1)];           
        NSData *cachedImage2 = [[NSData alloc] initWithBytes:sqlite3_column_blob(stmt, 2) length: sqlite3_column_bytes(stmt, 2)];           
        NSData *cachedImage3 = [[NSData alloc] initWithBytes:sqlite3_column_blob(stmt, 3) length: sqlite3_column_bytes(stmt, 3)];           

        thumbImage = [UIImage imageWithData:cachedImage1];
        bgImage = [UIImage imageWithData:cachedImage2];
        logoImage = [UIImage imageWithData:cachedImage3];
        [cachedImage1 release];
        [cachedImage2 release];
        [cachedImage3 release];

    }
}

I tried to display using the following code…

bCardFront.image=[UIImage imageNamed:bgImage]

but it dispays the warning message that says

incompatible Objective-C types ‘struct UIImage *’, expected ‘struct NSString *’ when passing argument 1 of ‘imageNamed:’ from distinct Objective-C type

Can anyone please tell me how to display this images in separate imageviews.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:34:36+00:00Added an answer on June 3, 2026 at 6:34 am

    bCardFront.image=[UIImage imageNamed:bgImage] replace to

    bCardFront.image=bgImage here bgImage is not image name it is object of UIImage

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have stored an image in a database using Blob type. Now I can
I have an image file which is stored onto database as a blob (shown
I have stored an Image to Database. I can get the blob but unable
I stored it images in the database using an BLOB field (I'm using SQLite).
Hi I have a image table in my database. These are stored as blob
I've written an PHP page to dynamically resize an image stored as a BLOB
I successfully stored image files in MongoDB using PHP, when i retrieve images from
i want to retrieve image stored in mysql as path using php and display
I have currently got imagepaths stored within the database and image files stored in
May I know how to store an image manually into a database without using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.