Wednesday, March 23, 2011

Visual studio Light switch

                      

                              Visual Studio LightSwitch is a application development environment.It is a new addition to the Visual Studio family. Using Visual Studio LightSwitch you can develop a high-quality business application simpler and faster way without writing single line of code. It is power full development platform for creating applications for desktop and the cloud .Light Switch includes a lot of pre-built components for the most common business application tasks.

                     Click here  download the Light switch Beta 2 from following location. After success fully installed the Light switch open the visual studio and go to menu  -->file –> New project  (you can find the Light switch in your template list .

The below picture shows the light switch in Visual studio

lightSwitch

Thursday, March 17, 2011

JavaScript alert box with custom title

               Recently one of my friend got a requirement on customization of  JavaScript alert box.The requirement is  customizing the alert box title.There is no way to customize the alert box title  in Java Script.I have given a solution using jQuery alert box.I have discussed possible ways to implement it and I have mentioned my recommendation also.

  1. Creating new page (.html or .aspx) name it as "Message box" and  pop up it using Window.open(..)..
  2. The second ways is using vb script .But it is only works in IE browser.
  3. Jquery plug in .(Recommended way).The below example demonstrate you how to use jquery alert box plug in .

Add the  following file reference to your page header.

<script src="Scripts/jquery-1.4.1.js" type="text/javascript"/>
  <script src="Scripts/jquery.alerts.js" type="text/javascript"/>
  <link href="Styles/jquery.alerts.css" rel="stylesheet" type="text/css"/>

Add a button in your page



<asp:Button ID="Button" runat="server" Text="Click Me" />

Add this content to your in between  header tag



   1: <script type= "text/javascript" language="javascript">
   1:  
   2:      $(document).ready(function () {
   3:          $("#Button").click(function () {
   4:              jAlert('Wow !My alert message with custom titile','My custom title bar here...');
   5:              return false;
   6:          });
   7:      });
   8:     
</script>

Run the application .Now you can find the following out put .Let me know if you face any issues .CustomTitle

Monday, March 14, 2011

Integrate anksh with vs2010

                        AnkhSVN provides source code management support to all project types supported by Visual Studio and allows you to perform
The most common version control operations directly from inside the Microsoft Visual Studio IDE.

    • click the here  to download the ankshSVN.
    • you can register or skip it, download it and install .
    • open vs2010 with administration mode
    • In Visual Studio got to tools ->options –>Expand   the "Source Control" node
    • Select the Plug in-Selection child node(See the screen shot)EnableSubVersion
    • Select the "AnkhSVN-Subversion Support for Visual Studio" in  dropdown list
    • Click on Ok button.
    • Now “AnkhSVN” enabled in your IDE.

Restore sticky notes which are deleted in windows 7

                              Windows 7 has provided one of excellent feature is called "Stick Notes".Sticky Notes just got more useful.In Windows 7, you can format a note’s text, change its color with a click, and speedily resize, collapse,and flip through notes.
                               Unfortunately some one  has deleted my sticky notes in my PC.OH!!!!! .I have tried different ways to restore my stick notes .Finally i achieved it .Here is the solution . 
 
Got to your computer   C:\Users\<UserName>\AppData\Roaming\Microsoft\Sticky Notes
The file is called StickyNotes.snt(There is only one file per <UserName>, which contains all the notes in a single file.)

UpdatedStickyNote

Note: That you need to be able to view hidden files and folders - see Hidden Files and Folders - Show or Hide for details.

Thursday, March 10, 2011

Table types doesn’t support Entity Framework

 

/// <summary>
///
Saves bulk employees at once
/// </summary>
/// <param name="dtContainer"></param>
public void SaveEmployees(DataTable dtContainer) //this dtContainer exactly match your table type which is created in sqlserver
{
using (var context = DataObjectFactory.CreateContext())
{
SqlParameter param = new SqlParameter("@YourSPParameterNameHere", SqlDbType.Structured);
param.Value = dtContainer;
param.TypeName = "EMPItemsType"; //Name of you tabletype which you have created in sqlserver
EntityConnection entityConnection = (EntityConnection)context.Connection;
SqlConnection sqlConnection = (SqlConnection)entityConnection.StoreConnection; //getting sqlconnection string from EntityConnection
sqlConnection.Open();
SqlCommand sqlCommand = new SqlCommand("SaveEmployees", sqlConnection); // specify the sp name
sqlCommand.CommandType = CommandType.StoredProcedure;
sqlCommand.Parameters.Add(param);
int result = sqlCommand.ExecuteNonQuery();
sqlConnection.Close();
}
}

Grouping Radio Buttons in ASP .NET MVC

 

               Radio buttons should only allow the user to select a single option out of multiple choices. This should be enforced by only allowing one radio button to be selected for each option set.But, what if your application has multiple options that all need radio buttons? How do you distinguish the radio buttons  from one option from the other.

                     This is where groups comes into picture.Recently i have started developing HTML extensions(Custom Controls) library for simplify this .I will post you the project later.To resolve the issue you can set the Name property for each of your radio button.

Getting SqlConnection from Entity Connection

        Hi all ,

             This is the code for accessing Entity connections string to sql connection string…      

 

 

EntityConnection entityConnection = (EntityConnection)context.Connection;
SqlConnection sqlConnection = (SqlConnection)entityConnection.StoreConnection;