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
krithika muthukrishnan
NA
234
705.7k
in data set i have an error
Dec 29 2010 3:35 AM
Hai,
I want to display a selected title details in a grid view using data bind method,
using query string i pass the selected title to the grid view page but the error occurs in dataset like "invalid column name str(ie)selected titlename"
how to solve this error?
public
void
bind()
{
string
str = Request.QueryString[
"titlename"
];
string
connectionstring =
@"data source=System-7\sqlExpress;initial catalog=Project;User ID=sa;Password=as;"
;
SqlConnection
con =
new
SqlConnection
(connectionstring);
con.Open();
string
query =
"select title,suggestion,owner,date from topic1 where title="
+ str;
SqlCommand
cmd =
new
SqlCommand
(query, con);
SqlDataAdapter
da =
new
SqlDataAdapter
(cmd);
DataSet
ds =
new
DataSet
();
da.Fill(ds);//I have an error in this line.
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
Reply
Answers (
2
)
I don't know how to display in a grid view
Syncronise Access DB on Vista machine