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.8k
about grid view
Dec 29 2010 7:48 AM
hai,
by using the two grid views when i using this coding.i have an error like "Both DataSource and DataSourceId are different,Remove one definition.How can i solve this
public
void
bind()
{
//string tid = ddlTitle.SelectedItem.Value.ToString();
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);
GridView1.DataSource = cmd.ExecuteReader();
GridView1.DataBind();
con.Close();
}
public
void
loadreply()
{
string
str1 = Request.QueryString[
"user1"
];
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 topic1.owner,replies.sender,replies.suggestion,replies.date from replies,topic1 where replies.user1= topic1.owner "
;
SqlCommand
cmd =
new
SqlCommand
(query, con);
GridView2.DataSource = cmd.ExecuteReader();
GridView2.DataBind();
con.Close();
}
Reply
Answers (
1
)
RETRIEVE GRIDVIEW CELL VALUE
HashTable Storing multiple Values in Single Key