Posted on: 5/21/2013 4:32:50 AM | Views : 186

I want to take UserId form user and then check if this UserId exist in database table, this is my code logic :
public partial class Main : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MembershipUser currentUser = Membership.GetUser(); string myUsername = currentUser.UserName; string myUserId = currentUser.ProviderUserKey.ToString(); SqlDataSource1.SelectParameters.Add("UserId", myUserId); if (UserId exist in SqlDataSource1) { Panel1.Visible=true; } else (if not exist / null) { //Some Code } } } any sugestion how can i accomplish that ?
Thank you for your help.
Regards,
...

Go to the complete details ...