ASP.NET Code💻 First Project Common Issues
- How to install a Database?
- How to run the migration?
- Database table not created?
- How to add/modify the DB connection sting in the appsettings.json file?
- Error: Invalid object name ‘DefaultIdentityOptions’.
- How to check the MSSQL server name?
Please follow these steps,
1. Make sure the right database connection is in the appsettings.json file.
2. Check your server running properly and get the server name by running this SQL Query:
select @@SERVERNAME as 'Server Name';
Here SERVERNAME in appsettings.json,
3. Delete the database from your SQL Management Studio (if already created)
No need to create migration rules and update the database. You just need to build and run the application. Already initial migration rule is included with the project. Please make sure the MS SQL server running properly.
4. Just build the project (As we have already included Migrations in the project)
5. Run the project
6. Now check your Database. Hopefully, the Database and all the tables you will find now.
7. Please cross-check the program.cs and appsettings.json files properly.
8. Example Connection String:
"connMSSQL": "Server=DESKTOP-HLGBAEE\\MSSQLSERVER2017;Database=BusinessERP;User ID=sa;Password=123;MultipleActiveResultSets=true",
Server = your local server
Database = any name
User ID=your local MSSQL Server user name
Password=your local MSSQL Server user password
9. DB Migration: [if required]
Tools → Nuget Package Manager → Package Manager Console
PM> add-migration initcreate
10. Check .Net Version:
Press Windows + R.
Type cmd. Open the command prompt,
On the command prompt, type dotnet — — version
Dynamic Database Connection String: [Red marked string name must be same]
If you want to modify or add new features, you can always contact us at,
📲 WhatsApp: 8801674411603
📢 Telegram: shahed71bd
📢 Skype: shahedatomap
🙏 Email: email@example.com
♾️ Web: https://netspeedm.com/