Aktham Mahmoud

Aktham Mahmoud

  • NA
  • 720
  • 38.1k

About save Uiniqidintifire type

Oct 12 2020 12:03 PM
  1. 9c28c6d9-9f56-4bb6-88f9-57312b50107d  
Greetin
I usetd to Ceate user Wizard to as one step when create user profile,when admin click on continou will move to next step creat staff details which will store is staff table as a sub of parent table (Users)
picture 1:(parernt Table users)
 
In sub-table (Staff) I used (UserId) as forigen key see picture 2
 
In front-end code (SQLDATASource), I'll remodify a code in insert mode;
Question here: What a principle type to store uniqueidentifier string or integer
  1. <InsertParameters>  
  2.     <asp:Parameter Name="UserId" Type="String" />  
  3. </InsertParameters>  
 
If I show USers table info (UserId) I see this value
  1. 9c28c6d9-9f56-4bb6-88f9-57312b50107d
it not integer jut a Nvarchar(Max)
 
 I serached before post my question to catch a USERID to implemeint this  value in detailsview load event; see that code:
  1. using Microsoft.AspNet.Identity;  
  2.   
  3. int userId = User.Identity.GetUserId<int>();  
 So what I do? to determine a true value, why them decleared it as integer; am lost
 
I can remix two table in one table if that easy, (move staff columns table  to Users  table), but I need them sperate.
Any suggestion?
Thanks 
 
 
 
 

Answers (1)