Posts

Showing posts from 2015

Upload image and other field in node js

Image
In the node js upload image and other file likes..(pdf,doc,jpg,png, etc.) with other field like name , email and other like as you . Html code.. <form class="form-horizontal" id="form" name="form" role="form" method="post" action="/products/add" novalidate="novalidate" enctype="multipart/form-data">  <div class="form-group">                 <label class="control-label col-sm-1" for="name">Name</label>                 <div class="col-sm-5">                     <input type="text" class="form-control" required="" placeholder="Name" name="name">                 </div>             </div>             <div class="form-group">                 <label class="control-label col-sm-1" for="name">Description</label>        

how to convert json into c#

Image
If you don't know the json format in c# then use this link . In this link you pass your json string in this and got c# class as model http://json2csharp.com/

Simple CRUD Node.js & Sql server

Image
This is simple example of CRUD operation in node js with sql server 1 create a table in sql server CREATE TABLE [dbo].[Customer]( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](max) NOT NULL, [address] [nvarchar](max) NOT NULL, [email] [nvarchar](max) NOT NULL, [phone] [nvarchar](20) NOT NULL,  CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED  ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] 2. Install package of "mssql". This is package for sql server in node js 3. create a separate js file "Settings" all credential of sql server .. exports.dbConfig = {     user: "sa",     password: "admin@123",     server: "localhost\\SQLEXPRESS",     database: "Node",     port: 1433 };   4. Create Common file for execute sql queries in one function 

How can I install .NET framework using InnoSetup

[ Files ] Source : "dependencies\dotNetFx40_Full_x86_x64.exe" ; DestDir : { tmp }; Flags : deleteafterinstall ; AfterInstall : InstallFramework ; Check : FrameworkIsNotInstalled Source : "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\MySql.Data\v4.0_6.5.4.0__c5687fc88969c44d\MySql.Data.dll" ; DestDir : "{app}\lib" ; StrongAssemblyName : "MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, ProcessorArchitecture=MSIL" ; Flags : gacinstall sharedfile uninsnosharedfileprompt [ Code ] procedure InstallFramework ; var ResultCode : Integer ; begin if not Exec ( ExpandConstant ( '{tmp}\dotNetFx40_Full_x86_x64.exe' ), '/q /norestart' , '' , SW_SHOW , ewWaitUntilTerminated , ResultCode ) then begin // you can interact with the user that the installation failed MsgBox ( '.NET installation failed with code: ' + IntToStr ( ResultCode ) + '.'

How to connect to SQL Server database using Node.Js

Description A quick overview on SQL Server configuration, in order to get connected through Node.Js Using "mssql" npm package to connect to SQL Server using Node.Js How to use "Connection" object to connect to SQL Server How to use "Request" object to execute SELECT statement and fetch results How to handle SQL Server Connection Errors (from Node Js) How to handle SQL statement execution Errors (from Node Js) http://www.techcbt.com/ Source Code: var sql = require( "mssql" ); var dbConfig = {      server: "localhost\\SQL2K14" ,      database: "SampleDb" ,      user: "sa" ,      password: "sql2014" ,      port: 1433 }; function getEmp() {      var conn = new sql.Connection(dbConfig);      conn.connect().then( function () {          var req = new sql.Request(conn);          req.query( "SELECT * FROM emp" ).then( function (recordset) {