Full Trust European Hosting

BLOG about Full Trust Hosting and Its Technology - Dedicated to European Windows Hosting Customer

SQL Server 2019 Hosting Europe - HostForLIFE.eu :: Create and Schedule a Job in SQL Server

clock August 16, 2019 09:27 by author Peter

In this article, you will learn how to create a new job and schedule that job for execution in SQL Server. What is a SQL Job? A job is a specified series of actions that SQL Server Agent performs. Use jobs to define an administrative task that can be run one or more times and monitored for success or failure. A job can run on one local server or on multiple remote servers. Some examples of SQL Jobs are automatic weekly backup, sending auto emails, newsletters, writing log files, and audit logs.


First of all, start SQL Server 2008 Management Studio. Expand Databases node and select a database you want to use to create and schedule a job from.

Image 1.
For this database I am going to create a job and schedule that job.

Now click on SQL Server agent and select "Jobs" and right-click and click on "New Job".

Image 2.

As you can see there are many steps, so let's go one by one. First provide a job name and description and click "OK".
General Tab


Image 3.

Now click on "Next". The step name is Steps and provides a name, type and select database and write a command to save in a location and click "OK".
Steps Tab

Image 4.

Now click on the "Schedules" tab and provide name, type, frequency and click "OK".
Schedules Tab

Image 5.

Now click on the alerts tab and click on the "Add" button and provide alert name, type, database name and click "Ok".
Alerts Tab

Image 6.

Now click on the notifications tab and select how you want notifications.
Notifications Tab

Image 7.

The final tab is the "Targets" tab that shows you the options of the target server, you can also select multiple target servers.
Targets Tab

Image 8.
Summary
In this article, we learned how to setup and schedule a job in SQL Server.

HostForLIFE.eu SQL Server 2019 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

 



SQL Server 2019 Hosting Europe - HostForLIFE.eu :: Introduction To SQL And SQL Commands

clock July 31, 2019 12:27 by author Peter

SQL

SQL stands for Structured Query Language. SQL is used to create, remove, alter the database and database objects in a database management system and to store, retrieve, update the data in a database. SQL is a standard language for creating, accessing, manipulating database management system. SQL works for all modern relational database management systems, like SQL Server, Oracle, MySQL, etc.

Different types of SQL commands
SQL commands can be categorized into five categories based on their functionality.

DDL
DDL stands for data definition language. DDL commands are used for creating and altering the database and database object in the relational database management system, like CREATE DATABASE, CREATE TABLE, ALTER TABLE, etc. The most used DDL commands are CREATE, DROP, ALTER, and TRUNCATE.
    CREATE
    CREATE command is used to create a database and database object like a table, index, view, trigger, stored procedure, etc.

    Syntax
    CREATE TABLE Employee (Id INT, Name VARHCAR (50), Address VARCHAR (100));

    ALTER
    ALTER command is used to restructure the database object and the settings in the database.

    Syntax
    ALTER TABLE Employee ADD Salary INT;

    TRUNCATE
    TRUNCATE command is used to remove all the data from the table. TRUNCATE command empties a table.

    Syntax
    TRUNCATE TABLE Employee;

    DROP
    DROP command is used to remove the database and database object.

    Syntax
    DROP TABLE Employee;

DML
DML stands for data manipulation language. DML commands are used for manipulating data in a relational database management system. DML commands are used for adding, removing, updating data in the database system, like INSERT INTO TableName, DELETE FROM TableName, UPDATE tableName set data, etc. The most used DML commands are INSERT INTO, DELETE FROM, UPDATE.
    INSERT INTO
    INSERT INTO command is used to add data in the database table.

    Syntax
    INSERT INTO Employee (Id, Name, Address, Salary) VALUES (1, ‘Arvind Singh’, ‘Pune’, 1000);

    UPDATE
    UPDATE command is used to update data in the database table. A condition can be added using the WHERE clause to update a specific row.

    Syntax
    UPDATE Employee SET Address = ‘Pune India’, Salary = 100 WHERE Id =1;

    DELETE
    DELETE command is used to remove data from the database table. A condition can be added using the WHERE clause to remove a specific row which meets the condition.

    Syntax
    DELETE FROM Employee WHERE Id =1;

DQL
DQL stands for data query language. DQL command is used for fetching the data. DQL command is used for selecting data from the table, view, temp table, table variable etc. There is only one command under DQL which is the SELECT command.

Syntax
SELECT * FROM Employee;

DCL
DCL stands for data control language. DCL commands are used for providing and taking back the access rights on the database and database objects. DCL command used for controlling user’s access on the data. Most used DCL commands are GRANT and REVOKE.

GRANT
GRANT is used to provide access right to user.

Syntax
GRANT INSERT, DELETE ON Employee TO user;

REVOKE
REVOKE command is used to take back access right from the user, it cancels access right of the user from the database object.

Syntax
REVOKE ALL ON Employee FROM user;

TCL
TCL stands for transaction control language. TCL commands are used for handling transactions in the database. Transactions insure data integrity in the multi user environment. TCL commands can rollback and commit data modification in the database. The most used TCL commands are COMMIT, ROLLBACK, SAVEPOINT, and SET TRANSACTION.

COMMIT
COMMIT command is used to save or apply the modification in the database.

ROLLBACK
ROLLBACK command is used to undo the modification.

SAVEPOINT

SAVEPOINT command is used to temporarily save a transaction, the transaction can roll back to this point when it's needed.

Syntax
Just write COMMIT or ROLLBACK or SAVEPOINT;

HostForLIFE.eu SQL Server 2019 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



SQL Server 2019 Hosting Europe - HostForLIFE.eu :: Triggers In SQL Server

clock July 19, 2019 09:07 by author Peter

A SQL trigger is a database object just like a stored procedure or we can say it is a special kind of Stored Procedure that automatically fires when an event occurs in a database. Learn what is a trigger in SQL Server and how to create triggers on a database table. A SQL trigger is a database object just like a stored procedure, or we can say it is a special kind of stored procedure which fires when an event occurs in a database. We can execute a SQL query that will "do something" in a database when an event is fired.

For example, a trigger can be set on a record insert in a database table. For example, if you want to increase the number of count of blogs in the Reports table when a new record is inserted in the Blogs table, we can create a trigger on the Blogs's table on INSERT and update the Reports table by increaing blog count to 1.

Difference Between a Stored Procedure and a Trigger
Triggers are fired implicitly while stored procedures are fired explicitly.

Types of Triggers
There are two types of triggers:

  • DDL Trigger
  • DML Trigger

DDL Triggers
The DDL triggers are fired in response to DDL (Data Definition Language) command events that start with Create, Alter and Drop, such as Create_table, Create_view, drop_table, Drop_view and Alter_table.

Code of a DDL Trigger
create trigger saftey 
on database 
for 
create_table,alter_table,drop_table 
as 
print'you can not create ,drop and alter table in this database' 
rollback;


When we create, alter or drop any table in a database then the following message appears:

DML Triggers
The DML triggeres are fired in response to DML (Data Manipulation Language) command events that start with with Insert, Update and Delete. Like insert_table, Update_view and Delete_table.
    create trigger deep 
    on emp 
    for 
    insert,update,delete 
    as 
    print'you can not insert,update and delete this table i' 
    rollback;


When we insert, update or delete in a table in a database then the following message appears,
dml-triggers-in-sql.jpg
There are two types of DML triggers

AFTER Triggers
AFTER triggers are executed after the action of an INSERT, UPDATE, or DELETE statement.
    create trigger insertt 
    on emp 
    after insert 
    as 
    begin 
    insert into empstatus values('active') 
    end  


INSTEAD Of Triggers
It will tell the database engine to execute the trigger instead of executing the statement. For example an insert trigger executes when an event occurs instead of the statement that would insert the values in the table .

    CREATE TRIGGER instoftr 
    ON v11 
    INSTEAD OF INSERT 
    AS 
    BEGIN 
    INSERT INTO emp 
    SELECT I.id, I.names 
    FROM INSERTED I 
      
    INSERT INTO emp1values 
    SELECT I.id1, I.name1 
    FROM INSERTED I 
    END  

When we insert data into a view by the following query then it inserts values in both tables :
    insert into v11 values(1,'d','dd') 

You can see both tables by the folowing query:
    select * from emp 
    select * from emp1values 

HostForLIFE.eu SQL Server 2019 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

 



Angular.js Hosting UK - HostForLIFE.eu :: Two Way Data Binding In Angular

clock July 4, 2019 11:52 by author Peter

This article will explain the two-way data binding in Angular. I would recommend you read the below articles before starting with this one.

  • Interpolation data binding in angular
  • Property Data binding in angular
  • Class data binding in angular
  • Style data Binding in angular
  • Attribute data Binding in angular
  • Event data binding in angular

What is two-way data binding Angular?
Using two-way binding, we can display a data property as well as update that property when the user makes changes. We can achieve it in the component element and HTML element, both. Two-way data binding uses the syntaxes of property binding and event binding together. Property binding uses the syntax as bracket [] or bind and event binding uses the syntax as parenthesis () or on and these bindings are considered as one-way bindings. Two-way binding works in both directions setting the value and fetching the value. Two-way binding uses the syntax as [()] or the bindon keyword. It also called the "banana in the box" symbol. It looks like a banana in a box.

Let us see two-way data binding with an example.

Step 1
Open the command prompt from Windows search.

Step 2
Create a new project in Angular.
ng new AngularDemo

Step 3
Open the project in Visual Studio Code. Type the following command to open it.
Code .

Step 4
Open terminal in Visual Studio Code and create a component, "employee".
ng g c example

Step 5
Open the example component in your application and change the code with the following one.
import { Component, OnInit } from '@angular/core'; 

@Component({ 
selector: 'app-example', 
templateUrl: './example.component.html', 
styleUrls: ['./example.component.css'] 
}) 
export class ExampleComponent { 
firstName: string = ""; 
lastName: string = ""; 

fullname() { 
return this.firstName + " " + this.lastName; 



Step 6
Open example.component.html in your application and change the code with the following one.
<div class="container"> 
<h3 class="text-uppercase text-center">Two Way data binding in angular</h3> 
<div class="row"> 
    <div class="col-md-4"> 
        <div class="form-group"> 
            <label>First Name:</label> 
            <input [value]="firstName" class="form-control" (input)='firstName= $event.target.value'> 
        </div> 
    </div> 
    <div class="col-md-4"> 
        <div class="form-group"> 
            <label>Last Name:</label> 
            <input [value]="lastName" class="form-control" (input)='lastName= $event.target.value'> 
        </div> 
    </div> 
</div> 
<h4 class="text-uppercase ">{{fullname()}}</h4> 
</div> 


Step 7
Open app.component.html in your application to take the selector name from employee.component.ts.
< <app-example></app-example> 

Step 8
Run the application by typing the following command.
ng serve –open

Another example of two-way data binding using FormsModule
Step-1 Open app.module.ts and import FormsModule as shown in the image. Change the code with the following one.

Step-2 Open example.component.ts write below code
import { Component, OnInit } from '@angular/core'; 
@Component({ 
selector: 'app-example', 
templateUrl: './example.component.html', 
styleUrls: ['./example.component.css'] 
}) 
export class ExampleComponent { 
public firstName:string=''; 
public lastName:string=''; 
public position:string=''; 
public salary:number; 


Step-3 Now open example.component.html and write below code

<div class="container"> 
<h3 class="text-uppercase text-center">Two Way data binding in angular</h3> 
<div class="row"> 
    <div class="col-md-4"> 
        <div class="form-group"> 
            <label>First Name:</label> 
            <input type="text" class="form-control" [(ngModel)]="firstName">                
        </div> 
    </div> 
    <div class="col-md-4"> 
        <div class="form-group"> 
            <label>Last Name:</label> 
           <input type="text" class="form-control" [(ngModel)]="lastName"> 
        </div> 
    </div> 
</div> 
<div class="row"> 
    <div class="col-md-4"> 
        <div class="form-group"> 
            <label>Position:</label> 
            <input type="text" class="form-control" [(ngModel)]="position">         
        </div> 
    </div> 
    <div class="col-md-4"> 
        <div class="form-group"> 
            <label>Salary:</label> 
           <input type="number" class="form-control" [(ngModel)]="salary"> 
        </div> 
    </div> 
</div> 
<p> 
First Name:<strong class="text-uppercase">{{firstName}}</strong> 
</p> 
<p> 
Last Name:<strong class="text-uppercase">{{lastName}}</strong> 
</p> 
<p> 
Position:<strong class="text-uppercase">{{position}}</strong> 
</p> 
<p> 
Salary:<strong class="text-uppercase">{{salary}}</strong> 
</p> 
</div> 



WCF Hosting UK - HostForLIFE.eu :: Binding and Behavior in WCF

clock June 28, 2019 11:26 by author Peter

In this article I will clarify about the Binding and Behavior of WCF. It is one of the principal of WCF. Binding represents how the client can communicate with the service.

Assume we need to make the service for two clients , first client will access SOAP using HTTP and second client access Binary using TCP. Utilizing webservice it is impossible yet utilizing WCF we can do by including additional endpoint in the configuration file. Example: in web.config.
<?xml version="1.0"?>
<configuration>
  <system.web>
    <compilation debug="true" strict="false" explicit="true"targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="MathService"
        behaviorConfiguration="MathServiceBehavior">
        <endpoint
          address="http://localhost:9080/Service1.svc"contract="IMathService"
           binding="wsHttpBinding"/>
<endpoint address="net.tcp://localhost:8080/MyService/MathService.svc"
       contract="IMathService"
                  binding="netTcpBinding"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
     </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

And now, I’ll tell you about the Behaviour at the service level. In the service behavior, I have mention the servieMetadata node with attribute httGetEnabled='true'. This attribute will specifies the publication of the service metadata. Similarly we can add more behavior to the service. <system.serviceModel>
  <services>
    <service name="MathService"
      behaviorConfiguration="MathServiceBehavior">
      <endpoint address="" contract="IMathService"
        binding="wsHttpBinding"/>
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="MathServiceBehavior">
        <serviceMetadata httpGetEnabled="True"/>
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

HostForLIFE.eu European WCF Hosting

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



European VB.NET Hosting - HostForLIFE.eu :: Drawing rubber-band lines and shapes in VB.NET

clock June 21, 2019 11:13 by author Peter

The lack of XOR Drawing feature in GDI+ was not certainly welcome in the programmer's community. I guess it will be hard to survive with this handicap.

In spite of this, I would like to show how we can draw rubber-band lines and shapes in GDI+ with just a few lines of code.

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
Dim size As Size = SystemInformation.PrimaryMonitorMaximizedWindowSize 
bitmap = New Bitmap(size.Width, size.Height) 
gB = Graphics.FromImage(bitmap) 
Dim bckColor As Color = Me.BackColor 
gB.Clear(bckColor) 
End Sub 
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) 
Dim p As Point = New Point(e.X, e.Y) 
x0 = p.X 
y0 = p.Y 
drag = True 
End Sub 
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) 
Dim p As Point = New Point(e.X, e.Y) 
x= p.X 
y = p.Y 
Dim cx As Integer = x - x0 
Dim cy As Integer = y - y0 
If drag Then 
Dim gx As Graphics = CreateGraphics() 
gx.DrawImage(bitmap, 0, 0) 
gx.Dispose() 
Dim g As Graphics = CreateGraphics() 
Dim pen As Pen = New Pen(Color.Blue) 
Select Case DrawMode
Case 1 
g.DrawLine(pen, x0, y0, x, y) 
Exit Select 
Case 2 
g.DrawEllipse(pen, x0, y0, cx, cy) 
Exit Select 
Case 3 
g.DrawRectangle(pen, x0, y0, cx, cy) 
Exit Select 
End Select 
g.Dispose() 
pen.Dispose() 
End If 
End Sub 
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) 
Dim cx As Integer = x - x0 
Dim cy As Integer = y - y0 
Dim pen As Pen = New Pen(Color.Blue) 
Select Case DrawMode 
Case 1 
gB.DrawLine(pen, x0, y0, x, y) 
Exit Select 
Case 2 
gB.DrawEllipse(pen, x0, y0, cx, cy) 
Exit Select 
Case 3 
gB.DrawRectangle(pen, x0, y0, cx, cy) 
Exit Select 
End Select 
drag = False 
pen.Dispose() 
End Sub 
Private Sub Form1_Paint(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.PaintEventArgs) 
Dim gx As Graphics = CreateGraphics() 
gx.DrawImage(bitmap, 0, 0) 
gx.Dispose() 
End Sub 
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)button1.ForeColor = Color.Red 
button2.ForeColor = Color.Black 
button3.ForeColor = Color.Black 
DrawMode = 1 
End Sub 
Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
button2.ForeColor = Color.Red 
button1.ForeColor = Color.Black 
button3.ForeColor = Color.Black 
DrawMode = 2 
End Sub 
Private Sub button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
button3.ForeColor = Color.Red 
button1.ForeColor = Color.Black 
button2.ForeColor = Color.Black 
DrawMode = 3 
End Sub 
Private Sub panel1_Paint(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.PaintEventArgs) 
button1.ForeColor = Color.Red 
button1.Focus() 
End Sub



Node.js Hosting Europe - HostForLIFE.eu :: Sending Email Using Node.JS

clock May 22, 2019 07:42 by author Peter

For sending an email using Node.js, we need a node package called nodemailer. Before this, we need to set up the Node environment. To download the latest version of Node, click this link and download.

Once downloaded, install the local environment and make it ready. For confirming the Node installation, open command prompt and type the following command and press enter.
node -v

We will get the currently installed version of Node.js. After completion of all this, follow the below steps.

Install the nodemailer package using Node.js command prompt with this command.
npm install nodemailer –s

Once installed, the package.json file will be modified with the dependencies of the nodemailer package.
After installing nodemailer package, import the file to our node.js file which we are using for sending an email. For importing any node package, we need to use -
var nodemailer = require('nodemailer'); 

Here, we have created an instance for nodemailer package as nodemailer. Now, we need to use the createTransport method for assigning the host and credentials for authentication. Find the below one.
var transporter = nodemailer.createTransport({ 
    host: 'mail.yourserver.com', 
    auth: { 
        user: [email protected]', 
        pass: 'password' 
      } 
})

Once we're finished with the above things, we need to construct the list of objects which are required to send an email. Check below.
var mailOptions = { 
    from: emailFrom, 
    to: emailTo, 
    cc: emailCc, 
    bcc: emailBcc, 
    subject: emailSubject, 
    html: emailContent 
  };


Now, we need to use the sendMail method with transporter instance as mentioned below. For this method, we need to pass the mailOptions variable which contains the details of sending an email and we have added the callback function.
transporter.sendMail(mailOptions, function(error, info) { 
        if (error) 
        { 
            res.send([{ 
                result: "failed" 
            }]); 
        } 
        else 
        { 
            res.send([{ 
                result: "success" 
            }]); 
        } 
    }); 


Now, the below part will summarize everything.
const express = require('express'); 
const app = express(); 
var nodemailer = require('nodemailer'); 
 
app.get('/sendmail', (req, res) => { 
  var transporter = nodemailer.createTransport({ 
    service: 'gmail', 
    auth: { 
      user: '[email protected]', 
      pass: 'gmail_account_password' 
    } 
  }); 
  var mailOptions = { 
    from: 'DAEMON <[email protected]>', 
    to: '[email protected]', 
    cc: '[email protected]', 
    bcc: '[email protected]', 
    subject: 'Reg: Send Email using node JS', 
    html: 'Welcome to Node JS' 
  }; 
transporter.sendMail(mailOptions, function (error, info) { 
    if (error) { 
      res.send([{ 
        result: "failed" 
      }]); 
      console.log("failed" + error); 
    } else { 
      res.send([{ 
        result: "success" 
      }]); 
    } 
  }); 
}); 
const port = process.env.PORT || 3000; 
app.listen(port); 
console.log('API server started on: ' + port); 

Just copy this all code and place it into a Node file and name that as Emailsending.js.
Now, open the Node js Command Prompt and execute the Node.js file.
For the execution of node js file, use
node file_name.js

 

Once the Node.js file is executed, just check this URL http://localhost:3000/sendmail. Here, sendMail is the get method for the above program.

HostForLIFE.eu Node.js Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

 



European Visual Studio 2017 Hosting - HostForLIFE.eu :: Using C# Regions To Improve Code Readability

clock May 17, 2019 09:44 by author Peter

An instructor I once had made a statement that has echoed in my head for years. When you are a programmer, you have two groups of end users, the people who will actually use the software, AND other programmers who may someday have to modify your code. With that in mind, I have always tried to write my code to be as easily readable to other programmers as possible.

Visual Studio .NET gives us some very handy tools to improve readability in our code. One that I am particularly fond of is the #region directive that allows us to collapse code in a customized manor.

Regions are created in this format,
#region MyRegion

your code here
#EndRegion

Everything that falls within the directives will be collapsible.

The method I've chosen to adapt is to create regions for each different type of element in a class (i.e. constructors, variables, methods, properties, enumerators) so that my code can be easily navigated.

Here is an example,

Doing this will keep your code more organized, which in turn will increase efficiency. And someday down the road when another programmer comes across your source code, they will be very thankful.


Umbraco 8.0.2 Hosting UK - HostForLIFE.eu :: How to Reset Umbraco Password?

clock May 8, 2019 11:13 by author Peter

Every computer user both desktop and computer connected to the network would have to know the username and password. Username is your identity to enter into a network, including ATM networks. While the password is the key to your username can be identified and can enter the network.

Username and password are very useful and should not be underestimated, because if your username and password known to other people, then all the data and systems that you have can be problematic. Therefore username and password is one of the important facilities in the computerized system. Besides passwords should be updated or updated at any time. For the system to which you have remained safe and comfortable.

The requirement to use a password:

  • Use a password that's at least 8 characters mixed with numbers and uppercase and lowercase letters.
  • Do not show while typing passwords on those around you.
  • Always remember your password.

Passwords are the key words that you have to remember, but there are times when you forgot your password. In this article, I will discuss how to reset the password on Umbraco 7 manually via database.You try to log into Umbraco but it turns out your password is incorrect. Not a problem as long as you have access to the database and filesystem. 

The first thing you should do is open SQL Manager later locate the folder umbracoUser. Umbraco user passwords stored in your database Umbraco in the umbracoUser table, in userPassword column.

In the table, look for your account to be reset, and make a note to Id you want to update. The password will be encrypted for security reasons, and the password will be stored as a hash for security. So we can not just simply typing long passwords in plain text and expect to get the results directly. We need to know the hash code for several common passwords.

1
2
userPassword Value :   /7IIcyNxAts3fvQYe2PI3d19cDU=
Password :             password
1
2
userPassword Value :   d9xnUXsUah9gycu7D0TpRYcx19c=
Password :             admin
1
2
userPassword Value :   bnWxWyFdCueCcKrqniYK9iAS+7E=
Password :             default

But Umbraco using hashing simple with just a few lines of code. You can generate your hashed password and put it in the user table Password column in umbracoUser table for your user account.

  1. string password = "mypassword";  
  2. HMACSHA1 hash = new HMACSHA1();  
  3. hash.Key = Encoding.Unicode.GetBytes(password);  
  4. string encodedPassword = Convert.ToBase64String(hash.ComputeHash(Encoding.Unicode.GetBytes(password))); 

You just use the generated hash the password and then update records in the table. After that you can log back into Umbraco with your new password.


HostForLIFE.eu Umbraco Hosting

HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.





European Entity Framework Hosting - HostForLIFE.eu :: What Is Entity Framework And How Entity Framework Core Is Different?

clock April 12, 2019 12:13 by author Peter

Entity Framework (EF) is Object Relational Mapper(ORM) for .NET. In simple words, it is a collection of libraries that connect the objects in code with the schema. EF is a bit different than other ORMs. It has a mapping layer between domain classes and schema. It is Microsoft’s recommended data access technology. Of course, data access can be achieved by writing your own DAL (Data Access Layer) using ADO.NET or by using third-party mappers like Dapper but EF is a persistent and open source framework supported by Microsoft. It is possible to perform full CRUD (Create, Read, Update, Delete) operations. EF can help in the consistency of task, developer's productivity, and LINQ syntax helps to use any RDBMS (regardless of SQL writing style ie: Oracle or SQL Server). Actually, the purpose of EF is to let developers focus on the domain, not on the database.

There are mainly three workflows for Entity Framework.

Database-first approach
In this workflow, a database is created first with all tables and related objects (i.e, stored procedures). Entity Framework creates domain classes using the Entity Data Model Wizard. In this approach, most of the efforts are focused on designing database structures. It is a traditional approach which many developers are doing for years.
 
This approach suites when different teams like DBA design the database and programmers are supposed to integrate the database with an application or when requirements/goal are not clear and changes in the database are incremental. Or, if you have already one long-lasting stable database and you have a scenario to use an existing database – well, it is still possible to convert an existing database to code-first approach (reverse engineering is challenging in some scenarios but it is doable).
 
Advantages

  • You can start initial development soon.
  • Existing databases can be utilized easily
  • If there are requirements like to have stored procedures, triggers, and table columns in a certain order (this feature is added in EF 2.1 now) then this workflow has an advantage over code first
  • If you need GUI for designing. For example: In SQL Server you can generate database diagrams and create or update objects from there.

Disadvantages

  • The sync of changes is not easy. For example, you make changes in schema or table which you need to sync on your different working environments. You would need an external tool or do it manually.
  • If you are interested in version control like Git or SVN, then you cannot do it with database first. EDMX has no history of changes.
  • Sometimes, changes in structures of the database are complicated to update EDMX
  • Classes generated in this approach are auto-generated

Code-first approach
In this approach, we first create domain classes and then EF generates database tables. It is possible to create POCO classes (business objects) and you have complete control of it. You can write classes with properties which generate tables with columns using Migration process. Along with migration, the History table is also generated which can give you a version control feature.
 
This is a good approach if you are the programmer and you are the one who designs the database as well. This approach is useful if changes in the database are more, the application is scalable and needs tracking as well.
 
Advantages
The database sync is easy for environments using migration. It is a really needed feature which makes it possible to upgrade or downgrade any change/commit.
You get control on the code so you can validate fields from classes as well

Disadvantages
No GUI so you need programming experience
We do not have real full control on the database, of course, EF is releasing a new version with many new features but let's say: It is not possible to create or remove trigger or stored procedures from EF until we use SQL in Context class.

Model-first approach
In simple words, this approach is based on the GUI. All you need is to create entities and relationships on EDMX design surface so it is like a UML diagram. From the Entity Data Model wizard, you can choose the Designer model and create your entities all in GUI. When you are done with your design, you can choose “Generate Database from model” to auto-generate domain classes and database. This approach can be useful if a data structure is big and you need very little control on the database. For example, if you need triggers or stored procedures or custom business logic on fields of entities, then you should consider either database first or code first.
 
Advantages
The visual design interface can help to create entities easily in a short time
Programming experience not needed

Disadvantages
Auto-generated code is a limitation here
Little control on database
Sometimes, EMDX auto-generated scripts still need modification which needs good SQL level of expertise to get a workaround.

How Entity Framework Core is different than Entity Framework?
Entity Framework Core(EF Core) is lightweight (collection of composable API), cross-platform (Linux, Windows, UWP) and extensible (with modern software practices). EF Core works with .NET Core but with .NET Core, it is recommended to use EF Core. Of course, all the features are not released yet and there are many features which are missing. The EDMX/Designer is missing in EF Core so model first is not possible with EF Core without using third party tools. EF Core supports both, database-first and code-first, approaches. Database first with EF Core is like; it reverse engineers the existing database which later can be used as code first. So, if you want to say strictly then database first is not fully supported. EF Core supports not only RDBMS(SQL Server, Oracle, etc.) but also non-relational stores and in-memory databases which can be used for unit testing.
 
Conclusion
In my opinion about workflows, there is no good or bad approach but our specific requirement helps to decide which one to choose. But, whatever flow you choose - never mix different workflows in one project.



About HostForLIFE

HostForLIFE is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2019 Hosting, ASP.NET 5 Hosting, ASP.NET MVC 6 Hosting and SQL 2019 Hosting.


Tag cloud

Sign in