Wednesday, 15 November 2017

What Is AngularJS?


AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
AngularJS is what HTML would have been, had it been designed for applications. HTML is a great declarative language for static documents. It does not contain much in the way of creating applications, and as a result building web applications is an exercise in what do I have to do to trick the browser into doing what I want?
The impedance mismatch between dynamic applications and static documents is often solved with:
  • a library - a collection of functions which are useful when writing web apps. Your code is in charge and it calls into the library when it sees fit. E.g., jQuery.
  • frameworks - a particular implementation of a web application, where your code fills in the details. The framework is in charge and it calls into your code when it needs something app specific. E.g., durandalember, etc.
AngularJS takes another approach. It attempts to minimize the impedance mismatch between document centric HTML and what an application needs by creating new HTML constructs. AngularJS teaches the browser new syntax through a construct we call directives. Examples include:
  • Data binding, as in {{}}.
  • DOM control structures for repeating, showing and hiding DOM fragments.
  • Support for forms and form validation.
  • Attaching new behavior to DOM elements, such as DOM event handling.
  • Grouping of HTML into reusable components.

Wednesday, 8 November 2017

Generate QR code in asp.net



               Follow Me To get Health tip and bodybuilding
instagram:sayyedtanveer1410




To generate QR Code in asp.net VB lang.

On Default.aspx page just put IMG tag.

 <img  id="img" alt="Alternate Text" />


On Default.aspx.vb 

Just Import MessagingToolkit.QRCode.Codec in namespace

 Dim data As String = "codens.blogspot.com"


  •              Dim qrCodeEncoder As New QRCodeEncoder()
  •             qrCodeEncoder.QRCodeBackgroundColor = Color.White
  •             qrCodeEncoder.QRCodeForegroundColor = Color.Black
  •             qrCodeEncoder.QRCodeEncodeMode = qrCodeEncoder.ENCODE_MODE.[BYTE]

  •             Dim scale As Integer = Convert.ToInt16(1) 'Here we need to give size of Qr
  •             qrCodeEncoder.QRCodeScale = scale
  •             Dim version As Integer = Convert.ToInt16(0)

  •             qrCodeEncoder.QRCodeVersion = version
  •             qrCodeEncoder.QRCodeErrorCorrect = qrCodeEncoder.ERROR_CORRECTION.H

  •             QRImageName = "Qr_IMG.Gif"
  •  qrImagePath = System.Web.HttpContext.Current.Server.MapPath("~\" & ConfigurationManager.AppSettings("ImageFolder").ToString & "\ImagesNew\")


  •             Try
  •                 If File.Exists(qrImagePath) Then
  •                     File.Delete(qrImagePath)
  •                 End If
  •             Catch generatedExceptionName As Exception
  •                 Throw
  •             End Try
  •             
  •             Dim bimg As Bitmap = qrCodeEncoder.Encode(data)
  •             bimg.Save(qrImagePath, System.Drawing.Imaging.ImageFormat.Gif)




Tuesday, 7 November 2017

How to convert linq query result in datatable


                         Follow Me To get Health and bodybuilding tip's
instagram:sayyedtanveer1410



LINQ stands for Language Integrated Query is a set of features introduced in Visual Studio 2008, using LINQ you can manipulate the data as similar SQL queries .Let us learn it practically how to convert LINQ query result to Datatable by creating one simple function.


Create function to named LINQResultQueryToDataTable which convert LINQ Result To DataTable as

public DataTable LINQResultQueryToDataTable<T>(IEnumerable<T> Linqlist) 
       { 
          
  1. DataTable dt = new DataTable();  
  2.   
  3.              
  4.             PropertyInfo[] columns = null;  
  5.   
  6.             if (Linqlist == nullreturn dt;  
  7.   
  8.             foreach (T Record in Linqlist)  
  9.             {  
  10.                   
  11.                 if (columns == null)  
  12.                 {  
  13.                     columns = ((Type)Record.GetType()).GetProperties();  
  14.                     foreach (PropertyInfo GetProperty in columns)  
  15.                     {  
  16.                         Type colType = GetProperty.PropertyType;  
  17.                              if ((colType.IsGenericType) && (colType.GetGenericTypeDefinition()  
  18.                         == typeof(Nullable<>)))  
  19.                         {  
  20.                             colType = colType.GetGenericArguments()[0];  
  21.                         }  
  22.   
  23.                         dt.Columns.Add(new DataColumn(GetProperty.Name, colType));  
  24.                     }  
  25.                 }  
  26.   
  27.                 DataRow dr = dt.NewRow();  
  28.   
  29.                 foreach (PropertyInfo pinfo in columns)  
  30.                 {  
  31.                     dr[pinfo.Name] = pinfo.GetValue(Record, null) == null ? DBNull.Value : pinfo.GetValue  
  32.                     (Record, null);  
  33.                 }  
  34.   
  35.                 dt.Rows.Add(dr);  
  36.             }  
  37.             return dt;  
  38.         }  
  39.   
       }  
The above function takes the LINQ query result and convert it into the Data Table