Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
object ref while passing SqlDataReader into DataSet in c#
Bineesh VP
Aug 24 2017 3:12 AM
176
Reply
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();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
HOW TO INSERT, DELETE and UPDATE a record
System.Data.SqlClient.SqlException: Incorrect syntax near '=