InvalidCastException: Objekt vom Typ „System.String“ kann nicht in den Typ „System.Int32“ umgewandelt werden.
Microsoft.Data.SqlClient.SqlBuffer.get_Int32()
Microsoft.Data.SqlClient.SqlDataReader.GetInt32(int i)
lambda_method37(Closure, QueryContext, DbDataReader, ResultContext, SingleQueryResultCoordinator)
Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable+AsyncEnumerator.MoveNextAsync()
System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable+ConfiguredValueTaskAwaiter.GetResult()
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync(IQueryable-Quelle, CancellationToken cancellingToken)
Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync(IQueryable-Quelle, CancellationToken cancellationToken)
Liquidation.Controllers.SuppliersController.Index() in LieferantenController.cs
- var sellers = waiting _context.Suppliers.OrderBy(s => s.SeqNo).ToListAsync();
Code: Select all
public async Task Index()
{
var suppliers = await _context.Suppliers.OrderBy(s => s.SeqNo).ToListAsync();
return View(suppliers);
}
Code: Select all
[Display(Name = "Seq No")]
public int SeqNo { get; set; }
Mobile version