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.
Loading
Amit ChoudharyPosted Feb 25, 2010, 4:15 AM
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 + "')";