title: How to Save Image URL and Image URL Read from SQL Server in android..?
body: <p>How to save Image(Image URL) in Sql server database with android application ,i have store/save images for base64 format in sql web server 2008,i want to image path(URL) store to database how to do i searched but not get in SQL Server with android concept help me please</p>
  
  <p>my code is:</p>
  
  <pre><code>Gallery select :
  ````````````````
       private void onSelectFromGalleryResult(Intent data) {
             // Uri selectedImageUri = data.getData();
             // saveFile(data);
              Bitmap bm = null;
              if (data != null) {
                  try {
                      bm = MediaStore.Images.Media.getBitmap(Admin.this.getApplicationContext().getContentResolver(), data.getData());
                      imgadminview.setImageBitmap(bm);
                      int bitmapByteCount= BitmapCompat.getAllocationByteCount(bm);
                      System.out.print(bitmapByteCount);
                      ByteArrayOutputStream bytes = new ByteArrayOutputStream();
                      bm.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
                      byteArray = bytes.toByteArray();
                      encodedImage = Base64.encodeToString(byteArray, Base64.DEFAULT);
                      btarray = Base64.decode(encodedImage, Base64.DEFAULT);
                      bmimage = BitmapFactory.decodeByteArray(byteArray, 0, btarray.length);
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              imgadminview.setImageBitmap(bm);
          }
  
  
  
  Insert Query :
  ``````````````
  
         @Override
              protected String doInBackground(String... params) {
  
                  try {
                      connectionClass = new ConnectionClass();
                      Connection con = connectionClass.CONN();
                      if (con == null) {
                          Y = "SQL Connection Error";
                      }
  
  
                      String query = "Insert into FD_ItemMaster(CatId,ItemName,Description,Image)values('"+catid+"','"+itemname+"','"+desc+"','"+img1+"')";
  
                      PreparedStatement preparedStatement = con.prepareStatement(query);
                      preparedStatement.executeUpdate();
                      Y = "Saved Successfully";
                      issucess = true;
                  } catch (Exception ex) {
                      issucess = false;
                      Y = ex.toString();
                  }
                  return Y;
              }
  </code></pre>