Search This Blog

Loading...

May 12, 2015

Kindo date picker – Set min value


Here I am going to explain, how we can stop users to entering any date prior to the current date .  In my previous assignment I was using Kindo datepicker  and my requirement was to limit the min value of kindodatepicker calendar, code is simple and easy  
$(document).ready(function () {
   $("#controlName").kendoDatePicker({});
    var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth();
    var yyyy = today.getFullYear();
 //Note:: here min values correctly limit the calander drop down to the proper date range
    $("#controlName").kendoDatePicker({ min: new Date(yyyy, mm, dd) });
});







Here you can't go back, so first date will be current date.

Apr 30, 2015

SQL: Order by clause for specific column using Substring and CharIndex


I have a table in my  database whose columns are MPID, MPDescription(someNumbers + “-“ + Textvalue), here are examples 

MPID
MPDescription
LogDate
12120
1020 -  ADescription
12-01-2001
2324200
234 – BCDescription
12-10-2002
023
1 – Acde
12-01-2005
10
1231 – CaxyZey
12-03-2006
0909
012-Bocyz
12-03-2007




I would like to sort MPDeescription column value based on description(ignore the number part) so description should be arrange in albhabetical orders, so I was looking my result set something like this

MPID
MPDescription
LogDate
023
1 - Acde
12-01-2005
12120
1020 -  ADescription
12-01-2001
2324200
234 – BCDescription
12-10-2002
0909
012-Bocyz
12-03-2007
10
1231 – CaxyZey
12-03-2006

Here I used substring alongwith CharIndex

Select 
       MPID , MPDescription,LogDate  from myTable
       order by Substring(MPDescription,CHARINDEX('-', MPDescription) +1,Len(MPDescription))

Jan 16, 2015

Async Query in Entity Framework 6



Microsoft added Async and Await .net 4.5 few asynchronous features in entity framework 6 to support the Asynchronous programming. For example when your database engine is performing some query execution there is nothing to do with your .Net code. Same time your .Net code serve another request.  With async and await feature in Entity framework removed an important trade of application performances. No one wants to build a slow and unresponsive system.

Jan 15, 2015

Building modern web applications using Asp.net Visual studio 2013



Recently I was reading new things about Visual studio 2013, I found following interesting training and article on How to build modern web applications using Asp.net.
  1. Power of Clouds   - With the power of clouds create your own app free with the use of latest Andoriod, IOS technlolgies.
  2. What's new for ASP.NET - What is new Visual studio & it's features
  3. Download Visual studio commuinity   - Any individual developer can develop his/her favorite app. It gives a classroom learning environment, you can contribute to open source and many more.
  4. Web developer tools and tips  -  Learn new web features including and see the direction of web tools. 
  5. Entity Framework - Get Sneak preview of 6.1 what's coming in Entity framework and learn the latest feature of entity framework
  6. Team Foundation Server - you will love it new team foundation features. e.g. Manage your agile board, team collaboration and testing.
     
  7.  Happy Coding!!!

     

Jan 7, 2015

How to convert C# List into XML Object


Here I am going to show, how we can convert a List object(C#) into a XML object .   In my below code I am calling one service method which return List of employees  ID and then I will convert that list to XML Object.


void button2_Click(object sender, EventArgs e)
{

 
serviceNameClient cli = new serviceNameClient();
 List<int>a = new List<int>(cli.EmployesIds());

 //Now Convert into xml

 DataContractSerializer dcs = new DataContractSerializer(typeof(List<int>)); MemoryStream ms = new MemoryStream();
  dcs.WriteObject(ms, a);
  ms.Position = 0;
 
XmlDocument doc = new XmlDocument();
  doc.Load(ms);
 
MessageBox.Show(doc.InnerXml);  
}

Follow by Email