hi,
I found on the net that to make a query one needs to create a dataset. therefore i have created a datatable to this dataset with 3 columns into into. Now i have created a query to display the information according to the query. the problem is that i cannot find have to fill the datacolumns with the value of the datareader.
DatabaseConnection.conn.Open();
cmd = new SqlCommand("Select Username,Password FROM tblUser where Username = 'asd'",DatabaseConnection.conn);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
ds.Receipt_No.dcUserColumn.DefaultValue = rdr[0].ToString();
}
rdr.Close();
SqlDataAdapter da = new SqlDataAdapter(sql,DatabaseConnection.conn);
da.Fill(ds, "Product");
MessageBox.Show (ds.Tables[1].Rows.Count.ToString());
DatabaseConnection.conn.Close();
CrystalReport1 rcp = new CrystalReport1();
rcp.SetDataSource(ds.Tables[1]);
crystalReportViewer1.ReportSource = rcp;
crystalReportViewer1.Refresh();