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
aditya immadi
NA
205
71.3k
search againest database
Aug 1 2013 10:08 AM
i'm facing the error while i'm developing search againest database with the help of autocompletion ,when user enters the name and clicks the go button i'm trying to pull the data bbut i have this error...none of my google results solve my problem .can any one solve this
Null reference exception was handled by user code
" Object reference not set to an instance of an object."
public partial class search1 : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
SqlDataAdapter da = new SqlDataAdapter("select * from Candidate1 where name = '"+Session["name"].ToString()+"'", cn);
DataSet ds = new DataSet();
da.Fill(ds);
DataList1.DataSource = ds.Tables[0];
DataList1.DataBind();
}
}
Thanks and Regards
Reply
Answers (
17
)
Retrieve data from database using ComboBox to GridView
Create controls at runtime