title: passing unique identifier as parameter to the SQL Query function
body: <p>This is my 'SQL' Query and have to pass the 'UserId' as the unique identifier to 'where' clause in the Query.</p>
  
  <pre><code>SELECT aspnet_Roles.RoleName, aspnet_Roles.Description
  FROM aspnet_Roles INNER JOIN
       aspnet_UsersInRoles ON aspnet_Roles.RoleId =  aspnet_UsersInRoles.RoleId INNER JOIN
       aspnet_Users ON aspnet_UsersInRoles.UserId = aspnet_Users.UserId
  WHERE (aspnet_Users.UserId = @param)
  </code></pre>
  
  <p>And the C# code where i want to pass the parameter is :</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data;
  using System.Data.SqlTypes;
  
  public partial class Forms_RolesMgt_RoleList_Default : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
  
      if (!this.IsPostBack)
      {
          DSRolesTableAdapters.aspnet_RoleUsersTableAdapter userRoleAdapter = new DSRolesTableAdapters.aspnet_RoleUsersTableAdapter();
          DataTable dt = new DataTable();
          Guid user = Guid.NewGuid();
          user = Guid.Parse(Session["UserId"] as string);
          Response.Write(user);
          dt = userRoleAdapter.GetDataByUserId(user);//At this line i am passing the parameter and getting the error
          UserRolesGrdView.DataSource = dt;
          UserRolesGrdView.DataBind(); 
      }
    }
  }
  </code></pre>
  
  <blockquote>
    <p>Error while running: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.</p>
    
    <p>Error in .xsd file while preview the data by query is: Failed to covert parameter value string to Guid</p>
  </blockquote>
  
  <p>Where am i going wrong?</p>