Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to store Base64string to SQLite database?

$
0
0

I'm already done converting image - base64string:
here is my code:

protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
{
try
{
base.OnActivityResult(requestCode, resultCode, data);
Bitmap bitmap = (Bitmap)data.Extras.Get("data");
pfp.SetImageBitmap(bitmap);

            MemoryStream stream = new MemoryStream();
            bitmap.Compress(Bitmap.CompressFormat.Png, 100, stream);
            byte[] ba = stream.ToArray();
            string bal = Convert.ToBase64String(ba, Base64FormattingOptions.None);
        }
        catch(Exception)
        {
        }
    }

My problem is, how to save the "bal" (Base64 String) to my SQLite database?

I want to use "bal" here:

person person = new person
{
fname = uFname.Text,
lname = uLname.Text,
email = uEmail.Text,
num = uNum.Text,
uname = uUser.Text,
pword = uPass.Text,
image =
};

Is there any other way to get that string (bal)?

Thanks in advance :)


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>