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
Satheesh Palani
NA
333
85.4k
Invalid attempt to read when no data is present.
Mar 30 2016 3:04 AM
Hi,
I tried to Retrieving Data from SQL by using the below code. But i am getting the following error
Invalid attempt to read when no data is present.
Try to help resolve my problem.
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace wenservdemo
{
public partial class Testpage1 : System.Web.UI.Page
{
protected void Read_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(connection string);
string str;
SqlCommand com;
con.Open();
str = "select * from tsttable1 where FName='" + FName.Text + "'";
com = new SqlCommand(str, con);
SqlDataReader reader = com.ExecuteReader();
reader.Read();
FName.Text = reader["FName"].ToString();
reader.Read();
LName.Text = reader["LName"].ToString();
reader.Read();
Company.Text = reader["Company"].ToString();
reader.Read();
Position.Text = reader["Position"].ToString();
reader.Close();
con.Close();
}
}
}
Reply
Answers (
7
)
I want to create dll of kendu text Editor view ..
how to use multiple master page to single content master pag