How to Scaffold -DbContext and table classes in different project ?

I had my EntityFramework model classes in a separate project. In order to write the models there, I just used the following command:

Scaffold-DbContext "Server=[ServerName];Database=[DatabaseName];Trsted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -Project "[Project Name]" -Force 

Scaffold-DbContext “Server=SERVER-2016;Database=GWV_Test; encrypt=false; User Id = sa; Password=Password1;” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Project “Core.DTO” -Context GwvTestContext -Force

How to add WcfTestClient in Visual Studio 2022?

Do you have the WCF tool installed?

Please check this in the VS installer by going to Modify your install and search for it in the Individual Components tab:

Step 1 – Open Visual Studio Installer – Click Modify – Select Individual components (tab) – add Windows Communication Foundation – press install .

The remote server returned an unexpected response: (413) Request Entity Too Large in WCF

<bindings>
  <wsHttpBinding>
  </wsHttpBinding>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IeNett" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_Ipricingservice" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_ICommonService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_ITransfer" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_ITransfer1" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_IAirService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_IB2BTMPService" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_IHotel" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
    <binding name="BasicHttpBinding_ITravelInsurance" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="666665536" maxReceivedMessageSize="666665536" useDefaultWebProxy="true" />
  </basicHttpBinding>
</bindings>

How to solve “You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect”.

While altering one procedure in my sql database i got above mentioned error. One of my college Mr.AjayGhosh who is an encyclopedia in MySQL database helped me to solve this issue.

SET SQL_SAFE_UPDATES = 0;
DELETE FROM temp_todo WHERE id NOT IN (SELECT idRetain FROM temp_Distinct);
SET SQL_SAFE_UPDATES = 1;

How to create database user and assign database visibilty in SQL Server?

Today my friend Ajmal requested a help to configure database user with permission to access only one database associated with that user.

Arun.T.K a young and dynamic database administrator who is an encyclopedia in MsSqlServer really helped me to achieve this task

Making a SQL Server database visible to only database owner and sysadmin role. This requires you to modify the database owner using store procedure, but likely not the one you expect.

USE [FlamingoB2C]
GO
CREATE LOGIN FlamingoUser with Password=’U$er_A@1234′ ( This will login user in database)
GO
USE [FlamingoB2C]
GO
CREATE USER FlamingoUser for login FlamingoUser; (This will create user for selected Login)
GO
USE [FlamingoB2C]
GO
EXEC sp_addrolemember ‘db_owner’, ‘FlamingoUser’ ( This will add this user in role database owner)
GO
USE [FlamingoB2C]
GO
EXEC sp_changedbowner [FlamingoUser] ( This will change the user to selected database owner)

Before running the above step we should remove the user from Security tab in specific database.

For disable unwanted database for specific user, we need to right click on the Sql server and go to properties. From there we need to select permissions. Deny permission for View any database.

Git PowerShell command line interface

There are a lot of different ways to use Git. There are the original command-line tools, and there are many graphical user interfaces of varying capabilities. 

Commands for different functions

git status –> This will get the details of files need to check in

git add . –> This will add the files

git commit -m “change set name here”

git checkout development branch

git fetch

git pull

git push -u origin BRANCH NAME”bugfix/WHSV2-2018-Return-to-work-Publish-Regiter-is-Not-working”

git checkout to your local branch”bugfix/WHSV2-2018-Return-to-work-Publish-Regiter-is-Not-working”

git merge develop

git checkout -b bugfix/WHSV2-2025-RTW-Register-Return-Date-is-showing-incorrect-Date( For Create new Branch)

How to restore MySql database in local system and Setting user privileges with the help of Command Prompt.

  1. Open a command prompt. – run –> cmd. OR
  2. Take the window in C: ProgaramFiles–> MySQL–>MySQL Server(Version)–>bin, type cmd in the address bar.
  3. Type MySQL -u root -p
  4. Then the password phrase will open. Type your password set in the MySQL server.

mysql -u root -p production(database name) < E:databasebkp.sql(bkp location)

How to create user and allow permissions to that user.