I am coding in asp.net web forms . I have table with users generated from asp.net by default I need to get current UserId which in my case by default is uniqueidentifier
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();