Ho questo codice:
codice:
public partial class Profile : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MembershipUser currentUser = Membership.GetUser();
Guid currentUserId = (Guid)currentUser.ProviderUserKey;
string connectionString = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
string querySQL = "SELECT FirstName, LastName FROM User_Profile WHERE UserId =" + currentUserId ;
SqlConnection conn = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand(querySQL, conn);
cmd.Parameters.AddWithValue("@UserId", currentUserId);
conn.Open();
cmd.ExecuteNonQuery();
Response.Write("Utente corrente: " + currentUserId.ToString());
}
}
quando lo mando in esecuzione ecco l'errore che mi viene fuori:
Eccezione di tipo 'System.Data.SqlClient.SqlException' in System.Data.dll non gestita nel codice utente
Ulteriori informazioni: Sintassi non corretta in prossimità di 'de68'.
Il parametro passato(UserID) è questo: "1579de68-26d3-405d-a898-5fcda4ca14a2"
Cosa sbaglio?