Hi Sir,
An error is coming while I passing SqlDataReader into DataSet.
Kindly go through the code given below and suggest a solution.
- sqlRdr = sqlcmd.ExecuteReader();
- while (sqlRdr.Read())
- {
- dgvFeedBack.DataSource = sqlRdr;
- }
- if (!sqlRdr.HasRows)
- {
- RadMessageBox.SetThemeName("Windows7");
- RadMessageBox.Show("\nNo Records found between " + dtFromFeedback.Text + " and " + dtToFeedback.Text, "CollectPlus - Du Feedback", MessageBoxButtons.OK, RadMessageIcon.Exclamation);
- dgvFeedBack.DataSource = null;
- dgvFeedBack.Rows.Clear();
- btnExportData.Enabled = false;
- }
- lblTotalNoOfActions.Text = dgvFeedBack.Rows.Count.ToString();
- DsAllFeedback.Tables.Add().Load(sqlRdr);
- sqlCon.Close();