Skip to main content

Posts

Introduction to Microsoft SQL Server

Microsoft SQL Server is a Relational Database Management System(RDBMS) developed by Microsoft. It is one of the most popular RDBMS. SQL server has evolved from sql 1.0 in 1989  to the latest release of SQL Server 2019 (preview)  to become one of the best enterprise level database server's. SQL server is released with different editions. Express: Free to use entry level database which can use 1 core cpu, 1 GB ram and have maximum size of 10GB. Compact : Free embedded database for mobile app development and can have maximum size of 4GB. Enterprise : Full featured top end edition. Standard : Have less features than enterprise. WorkGroup: suitable for a company to use among the group. Developer: Same features like enterprise but is  licensed  to one user only. Web: Specially targeted for web application There are some other editions like Datacenter, Enterprise evaluation and Business Intelligence. These all editions are not available on all version o...

Update column with data from another table in SQL

  At different point of time we come up with a situation  where we need to update a column in a table from another  table based on some condition.   So a Basic Syntax for update is: UPDATE table SET column1 = expression1, column2 = expression2, ... [WHERE conditions]; For us to update based on another table we will be using the same syntax for update applying join with another table from  where we need the data. UPDATE t1 SET t1 .column_to_update = t2 .column_from_update FROM Table1 t1 INNER JOIN Table2 AS t2 ON t1 .common_column = t2 .common_column

Configure DNS to use an external mail server in Windows Server

External mail server can be used in the hosting server by configuring Mail Exchange ( MX ) Record. The Domain Name System(DNS) has several types of resource records that full fill the name to ip address translation(Directly or indirectly). One of the widely used record is MX Record.        An MX record should return the fully qualified domain name of an email server and its preference value . MX Record can be configured by following the step below. 1. Open DNS Manager 2. Add A Record for your mail          (eg: mail.domain.com with the ip address of another server) 3. Add  MX Record and set FQDN  to the name assigned in A Record           (i.e mail.domain.com)      Preference number can have any value between 0 to 65535 and lower number sets for higher            priority. After completing this step, The mail server is pointed to the ip add...

SqlException: Login failed for user 'IIS APPPOOL\

This issue is related with the permission for application pool to connect with the sql. We can create login user with the name as specified in the exception  IIS APPPOOL\<name> and grant permission to the database. We can create new login user by opening the SSMS(Sql server management studio) navigate to Security>Login  Then Add the user by right clicking Login and selecting new login While creating user Navigate to UserMapping and tick the database for the specific user. This process will create the new user and gran permission to the user. Another Work Around Yet another simple way will be to change the application pool Identity property  To LocalSystem by navigating to the application pool and then advance setting.

Bubble Sort in C-Sharp

Bubble Sort is a simple sorting algorithms that iterates through a list and compares adjacent item and swaps them in the order if they are in the wrong order.  The iteration is completed after the  items bubble to there specific position and the list is sorted ascending or descending. Bubble sort is simple but too slow and impractical in most of the cases. Figure : Algorithm: for all elements in Array if Array [ i ] > Array [ i + 1 ] swap ( Array [ i ], Array [ i + 1 ]) end if end for return Array CODE :

Reading and Writing to a file text file in C#

Lets start by taking the below  code as an example:    private void WriteToAFile(){             string data = "hi ! what's up";             string path = "data.txt";             if (!File.Exists(path))             {                 File.Create(path);             }             using (StreamWriter writer = new StreamWriter(path, append: true))             {                 writer.WriteLine(data);             } } Writing to a text file can be achieved by using StreamWriter class . To use this class we need to use System.IO namespace. if we are writing to a file then exception might occur if the file doesn't exists. So firstly ...