Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
ASPX Page Code: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:aspnetdbConnectionString %>" SelectCommand="SELECT * FROM [Fairs] WHERE (([Fair_ID] = @Fair_ID) AND ([Master_UserId] = @Master_UserId))"> <SelectParameters> <asp:Parameter Name="Fair_ID" Type="Int32" /> <asp:Parameter Name="Master_UserId" Type="Object" /> </SelectParameters> </asp:SqlDataSource> VB Code Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting Dim myObject As MembershipUser myObject = Membership.GetUser() Dim userid As String ' this just to test my code userid = myObject.ProviderUserKey.ToString() TextBox1.Text = userid ' This shows the correct user ID e.Command.Parameters("@Fair_ID").Value = 100 ' This line works ' next line fails in debug with error: ' Unable to cast object of type 'System.Guid' to type 'System.Data.Common.DbParameter'. e.Command.Parameters("@Master_UserId") = myObject.ProviderUserKey() ' the next line will not compile ' e.Command.Parameters("@Master_UserId") = myObject.ProviderUserKey.ToString() End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.