c# - Trying to set a non-null string to type 'System.Int32' -
The unit's outline is throwing this exception: 'BranchIdentity' running 'PasswordIterations' property Could not set to a 'system.String' value You must set this property in non-null value of type 'System.Int32'. This is throwing on this line: Exception only throws when one unit matches the query. . If there are no matches, then there is no exception My BranchIdentity Model: and my schema (taken from SQL database) - Auto-generated using code-first migration: I have tried to make
// Validate specificity or email and user name var user = sqlStorage.BranchIdentities.FirstOrDefault (i = & Gt; i.Username.ToLower () == View Model.User. TOLower ());
Namespace Branch.Models.Sql {Public Sector BranchIdentity {[Key] Public Integer ID { get receive; Set; } [Required] Public String Username {get; Set; } [Required] Public string passwordHash {get; Set; } [Required] Public string passwordSalt {get; Set; } [Required] Public et Password Retention {Receive; Set; } [Required] Public String Email {get; Set; } [Required] public string full name {get; Set; } Public Virtual Icon & Lt; Branch Identity Sessions & gt; Branch {IDENTIFICATION SESSION} Set; } Public virtual branch roll branch branch receipt; Set; } Received Public Virtual GamerIdentity GamerIdentity {}; Set; }}}
Table [dbo]. [BranchIdentities] ([id] INT identity (1, 1) No NULL, [username] NVARCHAR (max) NULL, [PasswordHash] NVARCHAR (max) NULL, [PasswordSalt] NVARCHAR (max) NULL, [PasswordIterations ] INT No NULL, [Email] NVARCHAR (MAX) No NULL, [BranchRole_Id] INT Zero, [GamerIdentity_Id] INT Zero, [FullName] NVARCHAR (Max) default ('') No NULL, Obstacle [PK_dbo.BranchIdentities] Primary key Package ([ID] ASC), Contract [FKDDO Bronchitis DDA] BranchRollsborsch Riv_ID] Foreign Key ([branch roll_id]] reference [DBO]. [ Branch code] [], [[ID]], contract [FKDDBO.bronkeyindtityw.W.GemarEditentsGameIndentity_ID] Foreign Keys ([GamerIdentity_Id]) Reference [DBO]. [GamerIdenti Relations] ([ID]));
password alert
the taps, but there is no benefit.
looks like your schema and the unit does not match, you post your code first generated code But since the table was formed, it could change. Take a look at the table in SQL Server Manager and double-check the data type for that column.
Comments
Post a Comment