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
Deepak Ratan
NA
175
50.5k
How to use INNER Join to select the statement
May 15 2015 12:33 AM
protected void statusgrdview_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblPostID = (Label)e.Row.FindControl("lblPostID");
string postID = lblPostID.Text;
DataSet ds = new DataSet();
con.Open();
stringcm dstr = "select a.comments,b.UName as CreatedBy from TBL_FBComment a inner join TBL_FBLogin b on a.CreatedBy=b.EmpID and a.CommentID=a.PostID";
SqlCommand cmd = new SqlCommand(cmdstr, con);
cmd.Parameters.AddWithValue("@PostID", postID);
SqlDataAdapter adp = new SqlDataAdapter(cmd);
adp.Fill(ds);
cmd.ExecuteNonQuery();
con.Close();
try
{
ListView inner = e.Row.FindControl("ListView1") as ListView;
inner.DataSource = ds.Tables[0];
inner.DataBind();
}
catch (Exception ex)
{
throw ex;
}
}
Reply
Answers (
7
)
What are some key differences of ASP and ASP.Net
Editor Like(Ck Editor)