0 Replies - 317 Views - Last Post: 08 February 2012 - 01:27 AM Rate Topic: -----

Topic Sponsor:

#1 vijayNavalgund  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-February 12

Image field is blank in crystal report

Posted 08 February 2012 - 01:27 AM

Respected Sir/Madam,

i am using sqlserver database with

Table Name User and fields
UserName nvarchar(30),
Photo image


i have added a data table with column name photo set to DataType System.Byte[]

now in crystal report i have dragged Photo field from DataTable lists.
however Photo is not being displayed in my crystal report following below is my .cs code



SqlConnection myConn1 = new SqlConnection();
myConn1.ConnectionString = "Data Source=B-1F60BB54;Initial Catalog=User_Tracking1;User ID=sa;Password=sa123";


try
{
            
myConn1.Open();
            
SqlCommand cmd1 = new SqlCommand("select UserName,Photo", myConn1);
           





            DataSet ds1 = null;
            SqlDataAdapter adapter;
         
            ds1 = new DataSet();
            adapter = new SqlDataAdapter(cmd1);
          
            ReportDocument rpt = new ReportDocument();
            string rptpath = Server.MapPath("CrystalReport.rpt");
            rpt.Load(rptpath);
            DataTable dt = new DataTable();
            dt.Locale = System.Globalization.CultureInfo.InvariantCulture;

            adapter.Fill(dt);
            adapter.Fill(ds1, "DataTable1");
            rpt.SetDataSource(ds1);
            CrystalReportViewer1.ReportSource = rpt;

           

        }



so please help me regd this
thanking you

This post has been edited by modi123_1: 08 February 2012 - 07:45 AM
Reason for edit:: please use code tags


Is This A Good Question/Topic? 0
  • +

Page 1 of 1