TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harish Batchu
NA
255
69.6k
error- System.InvalidOperationException: 'Invalid attempt to
Oct 11 2018 2:19 PM
error-
System.InvalidOperationException: 'Invalid attempt to read when no data is present.'
please the fix issue
SqlCommand cmd1 = new SqlCommand("ChartData",con);
cmd1.CommandType = CommandType.StoredProcedure;
cmd1.Parameters.Add("@Uuniq",SqlDbType.VarChar).Value = Username;
SqlDataReader dr = cmd1.ExecuteReader();
var datamodallist = new ObservableCollection<DatachartModal>();
if (dr.HasRows)
{
object viewdt = dr.Read();
object viewedt = dr.Read();
var datachartModal = new DatachartModal
{
Type = dr.GetString(0),
Amount = dr.GetString(1)
};
datamodallist.Add(datachartModal);
}
dr.Close();
class DatachartModal
{
public string Type { get; set; }
public string Amount { get; set; }
}
Reply
Answers (
2
)
In MVC View perform different types of crud operations
latest dotnet related information or new updates