나는 asp.net 웹 폼으로 코딩하고있다. 나는 사용자와 테이블이 기본 내가 현재의 사용자 아이디를 얻을 필요가 에 의해 asp.net에서 발생 가지고있는 기본적으로 내 경우uniqueidentifier 인 UserId를 얻는 방법
string user = User.Identity.Name; //this give me the name
string name = TextBoxCategoryName.Text;
this.connection.Open();
command = connection.CreateCommand();
command.CommandText = "insert into ProfitCategories(name, IdUser/*this is foreign key to Users table*/) values ('" + name + "', '"+user+"')";
command.ExecuteNonQuery();
connection.Close();
이 게시물은 질문에 대한 답변을 제공합니까? http://stackoverflow.com/questions/4769313/getting-the-guid-of-the-current-user – Netricity