Of note, I also have a 5.6 MySql instance I've tried this with. I'm getting the same error.
Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
I downloaded 11.0.1 Core MVC Jquery. This is a clean install, no modified code except as instructed in links.
I'm using the latest MySql connector (8.0.28), MySql.EntityFramework.Core (6.0.0).
I went through instructions detailed here: https://aspnetboilerplate.com/Pages/Documents/EF-Core-MySql-Integration :
As referenced in this ticket: https://support.aspnetzero.com/QA/Questions/10340/Update-Database-does-not-seed-data , the solution was to then run the migrator.
When I run the migrator I get the following error:
MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'surpathv2.abpeditions' doesn't exist
From Package Manager Console, with Web.Mvc as startup project, and EntityFrameworkCore as Default project, I run add-migration Initial_Migration
It generates the error:
Unable to resolve service for type 'Microsoft.EntityFrameworkCore.Storage.TypeMappingSourceDependencies' while attempting to activate 'MySql.EntityFrameworkCore.Storage.Internal.MySQLTypeMappingSource'.
In my database, the only table is __efmigrationshistory
My database configurater file reads as follows:
` public static class AspNetZeroDbContextConfigurer { public static void Configure(DbContextOptionsBuilder
public static void Configure(DbContextOptionsBuilder<AspNetZeroDbContext> builder, DbConnection connection)
{
//builder.UseSqlServer(connection);
builder.UseMySQL(connection);
}
}
`
I cleaned and rebuit my solution as detailed here: https://support.aspnetzero.com/QA/Questions/7462/Support-for-MySQL
No luck. Can someone please help me?
Thank you!
I had this same issue - so I entered same namespace but picked .NET 6.0 and downloaded - and I got a .net 6 download with updated files.
I think I closed this by mistake.
I knew this change was coming and I told them the license included changing the namespace once for up to a year.
I downloaded the upgrade incorrectly!
Please help!
WARNING: The download page does not properly detect the same namespace is entered and will use one of your project slots if you download an upgrade
In case anyone is looking at this - when you buy Aspnetzero, you get two namespaces to use for your project.
This is extremely important for a multitude of reasons, especially to do an update and change namespace because of a conflict. This is the scenario I'm in now, and I'm royally screwed by this.
When you create a project and need to get latest version to update your code - do not (I REPEAT DO NOT) enter the same namespace and download the latest version.
The site considers that a different namespace, even if it is the exactly the same project.
If you need to download an updated version, scroll down to recent downloads and there's a link to get that project, and if you click that it lets you get the latest version.
I made this mistake when I first started, and months later my client wants me to change my namespace.
ANZ - if you look at my downloads, you can see the issue - is there a way to get rid of one of those so I can get my project moved to the new namespace?
8.9 MVC Core
Using default metronic theme -
If I have a row, in the first column is a label and the 2nd has an input - how can I get the label to vertically center?
I can't find the correct class to assign it.
Anyone know which one I should use?
Hi @ismcagdas - I found a solution using the existing library.
Basically - the NPOI library has a nuance with how you get cells.
The nuance manifests in .cell[num] vs .GetCell[num] after GetRow.
The Cells collection simply drops empty cells.
Thus if you have an empty phone number field in the fourth column, the 5th column becomes the 4th column, and the import fails because it tries to read the column at the end and it doesn't exist.
In your code, worksheet.GetRow(row).Cells[4] is used.
However, if one were to do worksheet.GetRow(row).GetCall(4), in the above example, it returns a null.
Thus, my solution was to use simple counters for the order of the cells, and handle thusly:
int colCheck = 0;
int cellIndex = 0;
if (worksheet.GetRow(row).GetCell(colCheck) ==null) throw new System.ArgumentException("User Name is required");
user.UserName = GetRequiredValueFromRowOrNull(worksheet, row, cellIndex, nameof(user.UserName), exceptionMessage);
cellIndex++;
colCheck++;
if (worksheet.GetRow(row).GetCell(colCheck) == null) throw new System.ArgumentException("First Name is required");
user.Name = GetRequiredValueFromRowOrNull(worksheet, row, cellIndex, nameof(user.Name), exceptionMessage);
cellIndex++;
colCheck++;
if (worksheet.GetRow(row).GetCell(colCheck) == null) throw new System.ArgumentException("Last Name is required");
user.Surname = GetRequiredValueFromRowOrNull(worksheet, row,cellIndex, nameof(user.Surname), exceptionMessage);
cellIndex++;
colCheck++;
if (worksheet.GetRow(row).GetCell(colCheck) == null) throw new System.ArgumentException("Email is required");
user.EmailAddress = GetRequiredValueFromRowOrNull(worksheet, row, cellIndex, nameof(user.EmailAddress), exceptionMessage);
cellIndex++;
colCheck++;
// TODO Handle no phone number
if (worksheet.GetRow(row).GetCell(colCheck) != null)
{
worksheet.GetRow(row).Cells[cellIndex].SetCellType(CellType.String);
user.PhoneNumber = worksheet.GetRow(row).Cells[cellIndex]?.StringCellValue;
cellIndex++;
}
colCheck++;
if (worksheet.GetRow(row).GetCell(colCheck) == null) throw new System.ArgumentException("A valid password is required");
user.Password = GetRequiredValueFromRowOrNull(worksheet, row, cellIndex, nameof(user.Password), exceptionMessage);
cellIndex++;
colCheck++;
if (worksheet.GetRow(row).GetCell(colCheck) != null)
{
user.AssignedRoleNames = GetAssignedRoleNamesFromRow(worksheet, row, cellIndex);
cellIndex++;
}
colCheck++;
I've not refactored the code to be more elegant - but what this does is assume the column values are retreived in order.
Using GetCell, I am able to determine if a column has a value (not null). If it does, I increment the cell being examined (cellIndex) and column I'm checking (colCheck) and continue.
If the column is NULL after getcell, I know the cell has no value. In this case, I increment the column (colCheck) being examined, but do NOT increment the cells index (cellIndex) , since the cells array collapses empty values.
Hope this helps.
A more elegant approach maybe reconstruct the Cells array with a linq statement into a "rowvalues" array, or use the GetCell method.
While not perfect, my current approach is simple, and allows me to tinker while I work up my solution.
Thank you, that did it.
I uninstalled and reinstalled the tool, no luck.
Is there a way to enable debug logging?