Part of the sqldatasource parameters:
<asp:SqlDataSource ID="AllQuestionAskedDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:CP_AllQuestionsAnswered %>" SelectCommand="SELECT ThreadTitle
FROM Threads
WHERE UsersID=@UserID">
<SelectParameters>
<asp:Parameter Name="UserID" />
</SelectParameters>
</asp:SqlDataSource>
The code behind:
Guid userid = UsefulStaticMethods.GetUserNameFromUserGuid(name);
AllQuestionAskedDataSource.SelectParameters["UserID"].DefaultValue = userid;
It tells me that it cant convert userid from Guid to string. But the parameter must be a Guid for the select statement of the sqldatasource to work
<asp:SqlDataSource>
look like?? – marc_s Jul 11 '11 at 7:57<asp:SqlDataSource>
you should have more content - a<SelectParameters>
section etc. - that's where it would be defined what data type a parameter is.... most likely, this is set to "string" while you want to pass a "guid" – marc_s Jul 11 '11 at 7:58