473,394 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to assign Imagebox image to Entity object for Saving in Database.

Hi,
i have successfully able to load Image to imagebox in my Silverlight Application.Now i want to assign that selected image to the object that is carrying data to Service file to save records.
Below is my Code.
Code for how im Browsing n selecting Image.
Expand|Select|Wrap|Line Numbers
  1.  private void btnBrowse_Click(object sender, RoutedEventArgs e)
  2.         {
  3. OpenFileDialog objFileDialog = new OpenFileDialog();
  4.             bool? IsSelected = objFileDialog.ShowDialog();
  5.             objFileDialog.Filter = "Pictures (*.jpg)|*.jpg";
  6.             objFileDialog.FilterIndex = 1;
  7.             if (IsSelected == true)
  8.             {
  9.  
  10.                 BitmapImage bitImage = new BitmapImage();
  11.                 bitImage.SetSource(objFileDialog.File.OpenRead());
  12.                 image1.Source = bitImage;
  13.                 //Image1 is object of Image
  14.             }  
  15. }
  16. Code of Object that is carrying Data to Save Method in Service File.
  17. private void btnSave_Click(object sender, RoutedEventArgs e)
  18.         {
  19.  
  20. var objAlumni = new ServiceReference1.Alumni_Registration();
  21.   objAlumni.AY_ID = newAcadYearId;
  22.   objAlumni.CellNo = txtCellNo.Text;
  23.   objAlumni.ImageId = ;
  24.   services.AlumniRegAsync(objAlumni);
  25. }
  26.  
Please suggest how should i assign my Selected Image to object objAlumni
Aug 25 '11 #1
0 1456

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Blasting Cap | last post by:
I would like to try to see if an image uploaded to a SQL database is over a specific size, and if so, to resize it when it is displayed. The following is in the Page_load event. Dim strImageID...
1
by: ILPTAB | last post by:
Hello. Can somebody help me out here? I have a web server sitting on a DMZ that has DB2 UDB version 8 installed running on it. I would like this server to be completely independent of our...
0
by: soma.gunasekaran | last post by:
Iam trying to retriving the Image column and display in Picture box How to assign the image Column in the picture Box..... Dim file As String = ("D:\Documents and Settings\somasundaram\My...
0
by: shivavodnala | last post by:
retrieve image from sql server database when we click image button and it has to display on image control
0
by: miffer | last post by:
Hi everyone For reasons best known to our IT department, my department is not allowed to use SQL. Instead we have to use Access. No problem there, except we have a need to store images into a...
0
by: miffer | last post by:
For reasons best known to our IT department, my department is not allowed to use SQL. Instead we have to use Access. No problem there, except we have a need to store images into a database for...
0
by: hnpatel | last post by:
hello friends, i m making application in vb.NET. i m using MY SQL 5.0 and vs 2005 for this application. Now I want to save image file in sql database. i m using blob datatype of image field. i...
2
by: Andrus | last post by:
My instantiated entity object base type (entityBase) contains virtual empty validation methods. To implement runtime validation I need to overriide those validation methods after object is...
2
by: urschetan | last post by:
I just want to get an image from sql server database using linq and display that in WPF image box.....I am saving those images to a database directly and i also want to know in which format these...
2
by: Gunasegar | last post by:
Greeting to all am trying to create thumbnail from image stored in mysql database.. this is the coding am using to create the thumbnail... this works like charm.. but the problem is that the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.