Posts

SQL Server Identity with different possible operation on it.

Image
Hello folks,       I dentity column is very common in database design when we want to add a column as id and auto increment by itself. Some time this same feature is known as auto increment in different database(e.g. MYSQL).  Basically id column is if set as identity(auto increment), is automatically managed and increased by itself when new record(s) are inserted. So, get started with creating a new table in sql server with identity column. Either you can use sql query for this, CREATE TABLE tbl_person ( id INT IDENTITY (1, 1) PRIMARY KEY, name VARCHAR (255) NOT NULL, ); or you can use sql server management studio tool for this. You can set identity option for a column as shown in above screenshot. Here, you can set initial seed(first parameter in sql query) and increment seed (second parameter in sql query). On Successfully creation of table if we try to insert identity column column field explicitly the MSSQL server thro...

Email send in Magento 2

Image
In this blog post i am going to create a new module to send email form magento custom contat form 1. Create email_templates.xml file in app/code/Contact/Us/etc <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> <template id="send_email_email_template" label="Email Form" file="email_template.html" type="text" module="[Name_Space]_[Your_Module]" area="frontend"/> </config> 2. Create email_template.html in app/code/Contact/Us/view/frontend/email <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd"> <template id="send_email_email_template" label="Email Form" file=...

All in one post for magento 2.x installation and after installation troubleshoot for window users

Image
This blog is purely dedicated to window users who faced problem while installation or after installation with wamp server on windows. * 500 internal server error while navigating to magento root folder from browser   A quick solution to this is 500 Internal Server Error when installing magento2.x on windows is navigate to  httpd.conf   file of apache server, and search for this line   LoadModule version_module modules/mod_version.so you find # just before above line denoting that it is commented, you just have to uncomment this to load the required module on server, restart all services of your wamp. you may find your installation on browser now works fine. * After successfully installation of magento you may find this exception  Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/wamp64/www/mage23/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's na...

Invalid template file magento2.3.0

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'D:/wamp64/www/mage23/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block's name: 'require.js This is the problem with windows. Windows uses "\" as separator, the array "directories" contains entries with "/" as separator, so the check will always fail. So you need to fix this by replacing the separator in core file: Navigate to vendor>magento>framework>view>element>template>file>validator.php and replace this function by below code and run deploy command protected function isPathInDirectories ( $path , $directories ) { > if (! is_array ( $directories )) { > $directories = ( array ) $directories ; > } > $realPath = $this -> fileDriver -> getRealPath ( $path ); > $realPath = str_replace ( '\\' , ...