PDA

View Full Version : کریستال ریپورت(ضروری)



mmehdi
سه شنبه 09 بهمن 1386, 08:53 صبح
:چشمک:ضروری،به شدت )
دستوری که من می نویسم اینه:
SqlConnection conn = new SqlConnection("persist security info=false;integrated security=SSPI;database=compony;server='.'");
DataSet ds = new DataSet();
try
{
conn.Open();
SqlCommand cmd = new SqlCommand("select * from custemer");
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(ds);
CrystalReport3 cr = new CrystalReport3();
cr.SetDataSource(ds);
crystalReportViewer1.ReportSource = cr;
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
finally
{
conn.Close();
}
ولی خط: da.Fill(ds);
را errror میگیره

reza_rad
سه شنبه 09 بهمن 1386, 08:59 صبح
1- عنوان تاپیک را اصلاح کنید.
2- قوانین سایت (http://barnamenevis.org/forum/showthread.php?t=51814) را مطالعه کنید.