Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
object ref while passing SqlDataReader into DataSet in c#
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Bineesh VP
7y
201
1
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();
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
HOW TO INSERT, DELETE and UPDATE a record
System.Data.SqlClient.SqlException: Incorrect syntax near '=