string MyQuery = "SELECT tblBlogTopic.btopicId, tblBlogTopic.btopicTitle, tblBlogTopic.btopicDescription, tblBlogComment.bCommentDescriptin, tblBlogComment.bcdatetime, tblBlogComment.Empid FROM tblBlogTopic INNER JOIN tblBlogComment ON tblBlogTopic.btopicId = tblBlogComment.btopicId where (btopicId='" + lstboxforblogtitle.SelectedValue + "')";
While running the above query, i am getting the following error.
" Ambiguous column name 'btopicId' "
Could anyone plz help me.
Ambiguous column name 'btopicId'.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 24, 2010, 11:15 PM EST
see you have made mistake while writing the query...
in your where condition "
where (btopicId='" + lstboxforblogtitle.SelectedValue + "')"
well i have made changes in your query now copy and paste it in to your code.
string MyQuery = "SELECT tblBlogTopic.btopicId, tblBlogTopic.btopicTitle, tblBlogTopic.btopicDescription, tblBlogComment.bCommentDescriptin, tblBlogComment.bcdatetime, tblBlogComment.Empid FROM tblBlogTopic INNER JOIN tblBlogComment ON tblBlogTopic.btopicId = tblBlogComment.btopicId where (tblBlogTopic.btopicId='" + lstboxforblogtitle.SelectedValue + "')";