Xceedas

Xceedas
xceedas

Thursday 27 November 2014

Download .NET 2015 Preview

Microsoft .NET 2015 Preview integrated with open source .NET Core 5 stack is available for download.
 
.NET Core 5 is a completely open source stack, including the runtime as well as the framework libraries and can run on multiple operating systems.
 
Download the updates from the following links:


.NET 2015 includes ASP.NET 5, a new framework for building web and cloud applications. ASP.NET 5 is cross-platform and open source, and apps can run side-by-side with different versions of the framework on the same server.
 
ASP.NET 5 also brings a new developer experience built upon on-demand compilation, enabling a faster edit-debug cycle, and support for any code editor. Visual Studio 2015 includes all the familiar ASP.NET MVC tooling experiences for ASP.NET 5.
 
The .NET Framework 4.6 is the next version of the .NET Framework. New WPF features can be viewed fromhere.

Sony Developing E-Paper Watch

Sony’s new innovation, electronic paper watch is set to release next year.
 
E-Paper watch is developed by business creation division headed by Chief Executive Officer Kazuo Hirai. Popular for its Walkman and the Trinitron television, Sony is now trying for out of the box innovation.
Entire surface area of the watch will have display and can change its appearance.
 
Sony is trying to capture market for wearable technology which is set to grow fivefold in the next five years. Sony must offer something new to customers to be leader, as more and more similar devices launching every year

Register for Microsoft Ignite Conference

Register for Microsoft Ignite before 11 December to for a discount.
Top innovators from enterprise solutions meet in one place to discuss and reveal new opportunities and spark ideas. The conference is designed to benefit business owners and provide a glimpse into the future.
The Microsoft Ignite conference allows attendees to connect with other tech leaders, IT professionals and technology partners who’ll help you rise to the challenge and move your business forward. The event is equally beneficial for all, whether they are IT decision makers, IT professionals or enterprise developers.
The conference is scheduled for May 4–8, 2015 at Chicago, IL. Learn more about attending the conferencehere.
Featured speakers are:
1Satya Nadella, Chief Executive Officer, Microsoft
2 Brad Anderson, Corporate Vice President, Enterprise Client & Mobility (ECM), Microsoft
3 Julie Larson-Green, Chief Experience Officer, Applications and Services Group, Microsoft
4.Gurdeep Singh Pall, Corporate Vice President, Skype, Microsoft
5.Dave Campbell, Chief Technology Officer, Cloud & Enterprise, Microsoft
6Joe Belfiore, Corporate Vice President, PC, Tablet and Phone, Microsoft
7.Peggy Johnson, Executive Vice President, Business Development, Microsoft
8.Chris Jones, Corporate Vice President, OneDrive and SharePoint, Microsoft
Register before 11 December, 2014 to avail discount.

Friday 21 November 2014

ASP.NET - Password Strength Indicator using jQuery and XML

Couple weeks ago a CodeProject member reported that the "Password Strength Indicator using jQuery and XML plug-in" is displaying duplicate indicators. Yesterday, I was trying to integrate the plug-in with the MVC 3 application and ran into the mentioned issue.

Figure 1
double_bars2.gif

After spending some time digging into it, I noticed that there was a problem with the jQuery id selectors. I should use the Attribute Equals Selector [id="value"] instead of Attribute Ends with Selector [id$="value"]. The former selector selects elements that have the specified attribute with a value exactly equal to a certain value. The later selector selects elements that have the specified attribute with a value ending exactly with a given string. That explain why the bar indicator appears next to both the password and confirm password textboxes. I have updated the plug-in and here is the correct approach to use the plug-in.

Listing 1

<script type="text/javascript">
    $(document).ready(function () {
        var myPlugin = $("input[id='Password']").password_strength();

        $("[id='submit']").click(function () {
            return myPlugin.metReq(); //return true or false
        });

        $("[id='passwordPolicy']").click(function (event) {
            var width = 350, height = 300, left = (screen.width / 2) - (width / 2),
            top = (screen.height / 2) - (height / 2);
            window.open("PasswordPolicy.xml", 'Password_poplicy',
            'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
            event.preventDefault();
            return false;
        });
    });
</script>

Move Items From One List Box to Another List Box Using JQuery

The following is the output of my program. 

select country
                                                                                 Image 1

After selecting any item from the left side list box click on the ( >) button.

add country
                                                                                 Image 2

If you click on the ( >> ) button then all items in left side list box will move to the right side list box.

select all country
                                                                                 Image 3

After selecting any item in right side list box if you click on the ( < ) then:

select country left side
                                                                                 Image 4

If you click on the ( << ) then:

select all country left side
                                                                                 Image 5

The following is my aspx where I wrote the jQuery for this:
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>  
  2.   
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  4. <html xmlns="http://www.w3.org/1999/xhtml">  
  5. <head runat="server">  
  6.     <title>Move Item From One List To Another List Using jQuery</title>  
  7.     <script src="jquery-1.7.1.js" type="text/javascript"></script>  
  8.     <script type="text/javascript">  
  9.         $(document).ready(  
  10.             function() {  
  11.                 $('#btnAdd').click(  
  12.                     function(e) {  
  13.                         $('#list1 > option:selected').appendTo('#list2');  
  14.                         e.preventDefault();  
  15.                     });  
  16.   
  17.                 $('#btnAddAll').click(  
  18.                 function(e) {  
  19.                     $('#list1 > option').appendTo('#list2');  
  20.                     e.preventDefault();  
  21.                 });  
  22.   
  23.                 $('#btnRemove').click(  
  24.                 function(e) {  
  25.                     $('#list2 > option:selected').appendTo('#list1');  
  26.                     e.preventDefault();  
  27.                 });  
  28.   
  29.                 $('#btnRemoveAll').click(  
  30.                 function(e) {  
  31.                     $('#list2 > option').appendTo('#list1');  
  32.                     e.preventDefault();  
  33.                 });  
  34.   
  35.             });  
  36.     </script>  
  37.   
  38. </head>  
  39. <body11  
  40.     <form id="form1" runat="server">  
  41.     <table cellpadding="4" cellspacing="4" width="90%" align="center" style="border: solid 2px gray;  
  42.         background-color: #ADD8E6;">  
  43.         <tr>  
  44.             <td height="10px">  
  45.             </td>  
  46.         </tr>  
  47.         <tr>  
  48.             <td align="center">  
  49.                 <asp:ListBox ID="list1" runat="server" Width="250px" Height="100px">  
  50.                     <asp:ListItem Value="India">India</asp:ListItem>  
  51.                     <asp:ListItem Value="Australia">Australia</asp:ListItem>  
  52.                     <asp:ListItem Value="USA">USA</asp:ListItem>  
  53.                     <asp:ListItem Value="Japan">Japan</asp:ListItem>  
  54.                     <asp:ListItem Value="Brazil">Brazil</asp:ListItem>  
  55.                 </asp:ListBox>  
  56.             </td>  
  57.             <td align="center">  
  58.                 <input type="button" id="btnAdd" value=">" style="width: 50px;" /><br />  
  59.                 <input type="button" id="btnAddAll" value=">>" style="width: 50px;" /><br />  
  60.                 <input type="button" id="btnRemove" value="<" style="width: 50px;" /><br />  
  61.                 <input type="button" id="btnRemoveAll" value="<<" style="width: 50px;" />  
  62.             </td>  
  63.             <td align="center">  
  64.                 <asp:ListBox ID="list2" runat="server" Width="250px" Height="100px"></asp:ListBox>  
  65.             </td>  
  66.         </tr>  
  67.         <tr>  
  68.             <td height="10px">  
  69.             </td>  
  70.         </tr>  
  71.     </table>  
  72.     </form>  
  73. </body>  
  74. </html>  

Thursday 20 November 2014

Fiddler Software

I got one powerful tool tonight to share before sleeping...wow.
Fiddler is an HTTP debugging proxy server application written by Eric Lawrence, formerly a Program Manager on the Internet Explorer development team at Microsoft.[1]
Fiddler captures HTTP and HTTPS traffic and logs it for the user to review (the latter by implementing man-in-the-middle interception using self-signed certificates).[5]
Fiddler can also be used to modify ("fiddle with") HTTP traffic for troubleshooting purposes as it is being sent or received.[4] By default, traffic from Microsoft's WinINET HTTP(S) stack is automatically directed to the proxy at runtime, but any browser or web application (and most mobile devices) can be configured to route its traffic through Fiddler
On 6 October 2003, Eric Lawrence released the initial official version of Fiddler.[2]
On 12 September 2012, Eric Lawrence announced that Fiddler was acquired by Telerik and he would join the company to work on Fiddler on a full-time basis
I love the tool so much...laugh.
Click like if you like too.
Good night dude!

Insert, Update, Delete Data in LINQ to SQL Through DataGridView

Today in this article I will show you how to in insert, update, delete, display data in LINQ To SQL through DataGridView.

Start

1.Open your Visual Studio and make a new console project with any name.
2.Then open Server Explorer and make a new database with some name and make a new table. Add some columns to the table. 
3.Then open your project and go to to Solution Explorer and right-click on the project and then click Add new item. 
4.There search LINQ-To-SQL and add this file and press the OK button. 
5.Then you will see a blank file. On that file you will drag your table in the SQL Server database file onto the LINQ-To-SQL .dbml file extension.
LINQ-To-SQL 
Insert
private void SaveButton_Click(object sender, EventArgs e)
{
    StudentDataClasses1DataContext SDCD1 = new StudentDataClasses1DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\ehtesham mehmood\documents\visual studio 2012\Projects\FP1\FP1\abc.mdf;Integrated Security=True;Connect Timeout=30");
    StudentInfo SI = new StudentInfo();
    int rowindex = dataGridView1.CurrentRow.Index; // here rowindex will get through currentrow property of datagridview.
    SI.Id = Convert.ToInt32(dataGridView1.Rows[rowindex].Cells[0].Value);
    SI.Name = Convert.ToString(dataGridView1.Rows[rowindex].Cells[1].Value);
    SI.Marks = Convert.ToInt32(dataGridView1.Rows[rowindex].Cells[2].Value);
    SI.Grade = Convert.ToString(dataGridView1.Rows[rowindex].Cells[3].Value);
    SDCD1.StudentInfos.InsertOnSubmit(SI);//InsertOnSubmit queries will automatic call thats the data context class handle it.
    SDCD1.SubmitChanges();
    MessageBox.Show("Saved");
    rowindex = 0;
} 
Delete
private void button1_Click(object sender, EventArgs e)
{
    int iid = 0;
    StudentDataClasses1DataContext SDCD1 = new StudentDataClasses1DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\ehtesham mehmood\documents\visual studio 2012\Projects\FP1\FP1\abc.mdf;Integrated Security=True;Connect Timeout=30");
    StudentInfo SI = new StudentInfo();
    int rowindex = dataGridView1.CurrentRow.Index; // here rowindex will get through currentrow property of datagridview.
    iid = Convert.ToInt32(dataGridView1.Rows[rowindex].Cells[0].Value);
    var delete = from p in SDCD1.StudentInfos
    where p.Id == iid// match the ecords.
    select p;
    SDCD1.StudentInfos.DeleteAllOnSubmit(delete);// DeleteAllOnSubmit function will call and queries will automatic call thats the data context class handle it.
    SDCD1.SubmitChanges();
    // SI = SDCD1.StudentInfos.Single(c => c.Id == iid);
    rowindex = 0;
    MessageBox.Show("deleted");
    Refresh();
}
Update
private void button2_Click(object sender, EventArgs e)
{
    int iid = 0;
    StudentDataClasses1DataContext SDCD1 = new StudentDataClasses1DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\ehtesham mehmood\documents\visual studio 2012\Projects\FP1\FP1\abc.mdf;Integrated Security=True;Connect Timeout=30");
    StudentInfo SI = new StudentInfo();
    int rowindex = dataGridView1.CurrentRow.Index; // here rowindex will get through currentrow property of datagridview.
    iid = Convert.ToInt32(dataGridView1.Rows[rowindex].Cells[0].Value);
    var update = from s1 in SDCD1.StudentInfos
    where s1.Id == iid
    select s1;
    foreach (var v in update)
    {
        v.Id = Convert.ToInt32(dataGridView1.Rows[rowindex].Cells[0].Value);
        v.Name = Convert.ToString(dataGridView1.Rows[rowindex].Cells[1].Value);
        v.Marks = Convert.ToInt32(dataGridView1.Rows[rowindex].Cells[2].Value);
        v.Grade = Convert.ToString(dataGridView1.Rows[rowindex].Cells[3].Value);
        SDCD1.SubmitChanges(); // here will submitchanges function call and queries will automatic call.
    }
    MessageBox.Show("Updated");
    Refresh();// refresh the data gridview.
}
Display/Refresh
private void Refresh()
{
    StudentDataClasses1DataContext SDCD1 = new StudentDataClasses1DataContext(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\ehtesham mehmood\documents\visual studio 2012\Projects\FP1\FP1\abc.mdf;Integrated Security=True;Connect Timeout=30");
    StudentInfo SI = new StudentInfo();
    var query = from q in SDCD1.StudentInfos
    select q;
    dataGridView1.DataSource = query;// Attaching the all data with Datagridview
}