Hi Dear ,
this is my table structure
CREATE TABLE [dbo].[M_tbl_Company](
[Comp_Id] [int] IDENTITY(1,1) NOT NULL,
[Comp_Name] [varchar](250) NOT NULL,
[Comp_Address] [nvarchar](500) NOT NULL,
[Comp_Phone] [nvarchar](15) NOT NULL,
[Comp_Fax] [nvarchar](15) NOT NULL,
[LIC_No] [nvarchar](50) NOT NULL,
[Tax_Id] [nvarchar](50) NOT NULL,
[IsActive] [bit] NOT NULL,
[logo] [image] NULL,
[image] [varchar](50) NULL,
last two days i was working save image in Database ,data type image type and
i m using LINQ with WCF
i have created the WCF service and add in my silver light application
For open the image i use
private void btn_browseImage_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog objFileDialog = new OpenFileDialog();
bool? IsSelected = objFileDialog.ShowDialog();
objFileDialog.Filter = "Pictures (*.jpg)|*.jpg";
objFileDialog.FilterIndex = 1;
if (IsSelected == true)
{
BitmapImage bitImage = new BitmapImage();
bitImage.SetSource(objFileDialog.File.OpenRead());
image1.Source = bitImage;
}
}
and for Save button i use
private void btn_Save_Click(object sender, RoutedEventArgs e)
{
_client = new svcPOS.POSClient();
_client.SaveCompanyCompleted +=new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(_client_SaveCompanyCompleted);
svcPOS.M_tbl_Company _company = new svcPOS.M_tbl_Company();
_company.Comp_Name = txt_companyName.Text;
_company.Comp_Address = txt_companyAddress.Text;
_company.Comp_Phone = txt_phoneno.Text;
_company.Comp_Fax = txt_faxno.Text;
_company.Tax_Id = txt_taxId.Text;
_company.LIC_No = txt_LicNo.Text;
_company.logo=??????
all other data proper save in database ..
only image is remaining
"thanks for your reply in advance"