میشه اینا تصحیح و کامل کنید من بیشتر از این نتونستم
DataSet rds = newDataSet();
sqlConnection1.Open();
SqlCommand com = newSqlCommand();
com.Connection = sqlConnection1;
com.CommandText =
"select * from hame ";
com.CommandType =
CommandType.Text;
SqlDataReader dr = com.ExecuteReader();
string chcode;
CrystalReport1 cr = newCrystalReport1();
if (dr.Read())
{
chcode = dr[
"code"].ToString();
textBox1.Text = chcode;
cr.SetDataSource(rds);
Form2 test1 = newForm2();
((CrystalDecisions.Windows.Forms.
CrystalReportViewer)test1.Controls["crystalReportViewer1"]).ReportSource = dr;
f2.Show();
}