Posts

Showing posts from 2015

Create a DataTable from a Class using reflection .

There are many solution to this problem, For this we use a technical process called Reflection. Reflection: To dynamically create an instance  of a type, bind the type to an existing  object ad invoke its methods or access its fields and properties. If you are using attributes in your code, reflection enables you to access them. 1. Use AsEnumerable()  method to support LINQ: private List<T> ConvertToList<T>(DataTable dt)     {         var columnNames = dt.Columns.Cast<DataColumn>()             .Select(c => c.ColumnName)             .ToList();         var properties = typeof(T).GetProperties();         return dt.AsEnumerable().Select(row =>             {                 var objT = Activator.CreateInstance<T>();                 foreach (var pro in properties)                 {                     if (columnNames.Contains(pro.Name))                         pro.SetValue(objT, row[pro.Name]);                 }                 return objT;             }).

MVC application for Starters .

MVC is the framwork for creating Webapplication , in this we have bifercated the different components of the webapplicationas into different categories . M stands for model , which menas the datalayer in the form of a model . V stands for view this is the the html pages which is manupulated using the model and the controller. C which means controller, the controller is the class having multiple methods these methods are used to call the views . Basically the Controller is just a method function of the class inside the controller.MVC dll that is System.Web.MVC which contains the details that how the calling process can be carried by the action method. View are genrated using the Razor Engine which works when a view is called by the user. Razor engine Renders the whole html page and sends It as the response . Lets have a small example of creating MVC application . * Open visual studio. * Click File option. * Click new option. * Click the project option to start creati

Functions in VB.Net ?

In Vb.net we use procedure in place of function. Procedure is a group of statements which combined together perform a task. VB.net has two types of procedure Functions   Sub Procedure or Subs Funcion returns a value where as sub are non- return type procedure. Function  Example Function FindMax(ByVal num1 As Integer, ByVal num2 As Integer) As Integer    ' local variable declaration */    Dim result As Integer    If (num1 > num2) Then        result = num1    Else        result = num2    End If    FindMax = result End Function Sub Procedure Or Sub's Example    Sub CalculatePay(ByVal hours As Double, ByVal wage As Decimal)       'local variable declaration       Dim pay As Double       pay = hours * wage       Console.WriteLine("Total Pay: {0:C}", pay)    End Sub Please Subscribe or Comment!! if you need any other details please comment below. 

How to pass model in a ajax call to a method ??

Form MVC 3 or MVC 2 the objs passed in the form of json are automatically converted model format if the model of that type of object exists. Example Let say we have a model 'Customer' Public class Customer { public int CustomerID {get; set;} public string CustomerName {get; set;} public string CustomerAddress {get; set;} } Here we have a model 'Customer' with 3 attributes ID, Name, Address. Now we need to have a Get method and a post method public ActionResult Index() { return View(""); } [HttpPost] public ActionResult Index( Customer modelCustomer) { // Do your stuff here return View ("") } Here i have two different Function in the above code one is the httpGet method this is used to call the view where as the other is used to call the post method form the view may be using Submit or using ajax calls. here goes the code for ajax call @model iEnumerable @using (Html.BeginForm("Index", "Home" , FormMethod.Post ,

Passing multiple models in single view .

There are two different ways of doing this . * Passing parent view that contains both the models which we want to pass in the view . * passing each model in a ViewBag we have two different models public class Customer { public int CustomerID {get; set;} public string CustomerName {get; set;} } public class Product { public int ProductId {get; set ;} public string ProductName{get; set ;} } 1. By passing a parent view Here we want to pass both the models in a single view , by default the razor engine only accepts single model per view. so we need to create a parent view that hold both the models. public class ParentView { public Customer customer{get; set;} public Product product{get ; set;} } then we can call the model in the view by using the following code in view page : @model iEmumerable <models.ParentView> ForEach(var v in ParentView) { < option > @v.customer.CustomerID < / option > < option > @v.customer.CustomerName < / option &

A Briefing to MVC

Image
MVC  Its is a framework for better web application development . Before this used the Web Forms for the purpose of web application creation. Web application creates has a long runny heavy process in which the controller is connected and maintained by server. The details of every small control is connected and shared with server at every point. Thus MVC was introduced to get the a light weight web application. its uses the HTML controls to make the page . In web forms the controls are converted to the Html tags at run time but in MVC the the Html is created at the design time thus making it faster than any other web forms based application .  MVC has some positive points over the Web Forms   It provides better structure to web applications As controller created in MVC are class of  .Net thus its is easy to create unit cases and the automatic manual test cases. it can provide a better layored architecture to the user to work parallel on same application by multiple user.

Issue happened with MOSS 2007

Problem We have SharePoint server 2007 connected to the production environment with the SQL Data base name WSS_Content_P. Due to some technical changes we by mistake triggered the Production Front end to the Test environment Database that is WSS_Content_T . Here the Test database was just the replica of the production database with difference of 2 days. Now after some days we got to know that such a problem has been created. We found that business data of 2 days was missing from the database. Solution : In the End we came to solution to any how sync the two databases. Now we needed the best database comparison tool to check the data from the two database server. Tool Used :  VISUAL STUDIO Internal Tool : SQL > DATA COMPARE ·          Click the Data compare option in visual studio. ·          Provide the connection to both the databases, one will be source and other will be the destination. ·          Now we have four different option o    Different Records: Scans all the records

Working on Web application? Remember these Points for the UI prespective !!

We use multiple languages to create a web application but the browser is only able to understand HTML ,JS ,CSS etc.  Remember some points to create a better web application . 1. Mobile First Application - In  today's mobile world most of the people use mobile devices to access different websites. You first need to know your customer if you wish to go mobile try to keep in mind the concept of mobile first . Use responsive templates or themes to create applications. Generally before this developer use to check which device is accessing the website based on which they for the . Many of you have generally seen that when access many of the websites they shows m.website this ' m ' shows that the programmer has checked for the device and then routed you to different pages that is specific for mobile device. But in many cases i have seen the developers forget to check for the opposite . so the better idea is to use a responsive template which automatically changes the

What is Monitoring in SharePoint 2103? What are the other option in SharePoint 2013?

Image
Health Analyzer Review problems and solutions  Here we can check for the problem in the SharePoint server. These problems may include the details of low memory, high memory usage .There are many different ways by which these problems can be resolved. Review rule definitions  Here we can see different rules that are used to manage the rule definition. Timer Jobs   Review job definitions  Here we can review job definition i.e. hoe different jobs are scheduled with details of on which web application which timer job is running .these job can be clean up of logs list, trimming of log details, deletion of dead sites in web application.   Check job status    It is divided into three section scheduled, running and history .It shows when and how different services are executed on the server.   Reporting View administrative reports  Default document library of SharePoint used for managing the administrative reports. These reports may include data collected by the SharePoint health analyz

What is system setting in sharePoint2013? Other options in system setting in SharePoint2013?

Image
Servers Manage servers in this Farm : As we can have multiple server in single farm this option is to add up servers or remove server linked to the farm . Manage services on Server: Different server has been given different services to work upon . This option help us to make the efficient use of the server by ,managing the services required to the specific server . E-Mail and text Messaging (SMS) Configure outgoing e-mail settings : setting outgoing Emails for the SharePoint server. Configure incoming e-mail settings :setting Incoming Emails for the SharePoint server. Configure mobile account : This is used to set-up mobile accounts for getting notification alerts as short messages service  on mobile device . Farm Management Configure alternate access mappings : mapping of web application to the protocols of internal and public URLs. Manage farm features : enabling or disabling different features on the farm . such as search , BCS , visco services  etc. Manage Farm Soluti

What is Application Management? What are the meaning of the other options Available in Application Management in SharePoint 2013?

Image
Web Application Manage Web Applications : This section is specially for farm administrator of  the farm .This option has Manage permissions for a web application in SharePoint 2013 ,Manage permission policies for a web application in SharePoint 2013,Extend claims-based web applications in SharePoint 2013, Define managed paths in SharePoint Server 2013,  etc. we will discuss in details to these things in the upcoming blogs . Configure Alternate Access mappings :This option can be used to to associate the mapping of any web application to the collection of internal and public URLs .Web application supports five types of collection which are :default , intranet , extra-net internet and custom . Site collections Create Site Collections : user can create new site collection from this link . Delete a Site Collections : Users can delete a specific site collection from this link. Confirm Site use and Deletion :This section is to confirm weather the site is working or not in use . When

What is Central Administration in SharePoint 2013 Central ad What it Contains ?

Image
Central administration is a graphical interface utility to perform various functions related to SharePoint. These functions are classified as: 1. Application Management: Enables  user to manage web application, service application , create site collection and content database. 2. System Setting: Enables user to manage server, services and farm features. It also enables to configure alternate access mapping. 3. Monitoring: Enables user to review problems and solutions, web analytic report and check Job status. 4. Backup and restore: Backup and Restore enables user to perform backup, Restore from a backup and a site collection backup. 5. Security: Security enables user to manage the farm administrators group and Configure service accounts. 6. Upgrade and Migration: Upgrade and Migration enables user to convert farm license type, Check product and patch installation status And Check upgrade status 7. General Application Settings: General Application Settings enables use

Environments for SharePoint .

Image
SharePoint is very easy to install, just click few next buttons and it`s installed. To perform the SharePoint installation easily, various activities prior to installation needs to be performed. These activities are part of “Capacity Planning and management” activity.   SharePoint installation/deployment scenarios can be classified as: 1.  Standalone Installation : Most of the small enterprises prefer standalone installation scenario. This scenario enables user to install, SharePoint and SQL database on one physical server or virtual machine. 2.  Complete Installation : Most of the mid or large size, enterprise prefer farm installation scenario. The server farm installation can be performed as: ·            Multiple Server Installation : Add all the components installed on different servers with ability to add more servers as per need. Single Server Installation : Install all the components on single server 

SharePoint Basics?

SharePoint As it is clear from its name SharePoint is tool provided by Microsoft to create CMS(Content Management System) , RMS(Report Management System) and DMS (Document Management System).  It is server based tool used to create Intranet or Internet Web based solution . This is server based tool . It is tool to create fast and easy enterprise solution for creating Web based intranet  portal.