コードビハインドで私はこれを持っています:
protected void ButtonSave_Click(object sender, EventArgs e)
{
Guid guid = (Guid)Membership.GetUser().ProviderUserKey;
string name = TextBoxCategoryName.Text;
// string user = Membership.GetUser().UserName;
this.connection.Open();
command = connection.CreateCommand();
command.CommandText = "insert into ProfitCategories(name, IdUser) values ( '" + name + "', "+guid+" )";
command.ExecuteNonQuery();
connection.Close();
}
しかし、これはエラーを出します: Incorrect syntax near 'a8'.
how to get GUID from current user and insert into database