• Wriju's BLOG

    Windows Azure – Adding Portal Co-Admin

    • 0 Comments

    Earlier it was concern with a many customers regarding the credential sharing. Generally big bosses used to purchase the azure account and developers were using it. Then only one Live Account was allowed to login to one subscription, they had to share the user id and password which would not be an acceptable way. Now, things have become much more simple and you can add co-owner to your portal and they can use their Live id to access and share the same subscription.

    image

    After that add the user

    image

    Namoskar!!!

  • Wriju's BLOG

    How to add VM on Azure

    • 0 Comments

    A step by step guidance http://blogs.technet.com/b/gmarchetti/archive/2011/03/12/put-a-vm-on-azure.aspx 

    Namoskar!!!

  • Wriju's BLOG

    Windows Azure Billing - Understand usage statement

    • 0 Comments

    Every month you get a bill of your Windows Azure Platform usage. Below is the guide to help you understand the inside of it. You may also find some unused Hosted Service causing the pic of your bill.

    http://www.microsoft.com/windowsazure/support/understandbill/

    If you are a register Windows Azure user, you can check your bill at https://mocp.microsoftonline.com

    Namoskar!!!

  • Wriju's BLOG

    Windows Azure 1.3 – Deploying ASP.NET Applications

    • 0 Comments

    How to deploy Application to new Windows Azure 1.3 portal. This channel 9 video will walk you through step by step.

    http://channel9.msdn.com/posts/AzureDeploy

    image

    Namoskar!!!

  • Wriju's BLOG

    Windows Azure 1.3 Resources

    • 0 Comments

    Latest and updated resources on Windows Azure is here http://wriju.cloudapp.net/

    Namoskar!!!

  • Wriju's BLOG

    I want to develop Apps on Windows Phone

    • 0 Comments

    There are few new Virtual Labs available, hence you do not need full setup. All you need is your MSDN Virtual Lab

    Namoskar!!!

  • Wriju's BLOG

    Free Windows Azure till June 2011

    • 0 Comments

    Sign-up now to get free access to the following Windows Azure platform resources:

    • Compute:
      • 750 hours of an Extra Small Compute Instance
      • 25 hours of a Small Compute Instance
    • Storage:
      • 500MB
      • 10k Storage transactions
    • Data Transfers:
      • 500MB in / 500MB out
    • Relational Database:
      • 1G Web Edition SQL Azure database (for 90 days only)
    • AppFabric Access Control transactions:
      • 100k
    • AppFabric Service Bus connections:
      • 2

    http://www.microsoft.com/windowsazure/free-trial/

    Namoskar!!!

  • Wriju's BLOG

    Windows Azure Tools Error and Troubleshooting

    • 0 Comments

    When you try to develop Windows Azure Application using your Visual Studio 2010 and get the following error

    Windows Azure Tools: Failed to initialize Windows Azure storage emulator. Unable to start Development Storage.

    Few simple steps you need to follow is

    1. Go to Windows Azure SDK folder under program files

    2. Find DSInit.exe from C:\Program Files\Windows Azure SDK\v1.3\bin\devstore

    3. Run it as Administrator.

    4. Ensure that you have SQLExpress installed and accessible via localhost\SqlExpress

    Namoskar!!!

  • Wriju's BLOG

    Azure AppFabric : Two possible errors and troubleshooting

    • 2 Comments

    Azure AppFabric Access Control is an easy to implement feature. While I was trying to add it to one of my applications, I found two show stopping errors.

    1. A potentially dangerous Request.Form value was detected from the client (wresult="<t:RequestSecurityTo...").

    To solve you need to do two things

    a. Add below to Web.Config under <System.web>

    <

    httpRuntime requestValidationMode="2.0" />

    b. Add to <% @page of your .aspx page ValidateRequest="false"

    2. Another could be due to issue of loading user profile.

    Find out the Application Pool of your website in IIS.

    image

    From the IIS’s right side tree node open that App Pool. Go to Advanced settings of the app pool (here ASP.NET v4.0) and change the Load User Profile to True.

    image

    Namoskar!!!

  • Wriju's BLOG

    Windows Azure Storage Table Simplified

    • 3 Comments

    With Windows Azure 1.3 release I am super excited to see the most desired features addition and new portal. I will be posting on new feature soon. What remains the same as backbone of Windows Azure is the storage mechanism - a robust, secured and accessible location to capture user data apart from regular SQL Azure. Here I have tried to make it simplified for all of us who is starting new.

    What we want to achieve?

    We want to create a table called REEntry having few columns Alias, TopicTitle, Agenda etc., and from ASP.NET application we will store and view them.

    Create Windows Azure Application

    image

    image

    Then after that in the Solution Explorer choose the project WebRole1 and right click to choose setting.

    image

    Add a new setting called “DataConnection” of type Connection String as Windows Azure Storage Emulator. This will use the local SQL Express table to store during development.

    image

    Data Layer Class

    After that add a Class Library project to your solution called ReadinessEventDBLibrary. Here we will be creating all our Entity, Context and Public methods.

    We need to refer to assemblies here Microsoft.WindowsAzure.StorageClient and System.Data.Services.Client.

    After that we need to use the below using block,

    Using Block
    1. using Microsoft.WindowsAzure.StorageClient;
    2. using Microsoft.WindowsAzure;

    Entity Class

    We will have to define the Table structure

    Entity Class
    1. /// <summary>
    2. /// Entity Class for the Storage Table
    3. /// </summary>
    4. public class REEntry : TableServiceEntity
    5. {
    6.     //Public properties for the column values
    7.     public string Alias { get; set; }
    8.     public string TopicTitle { get; set; }
    9.     public string Agenda { get; set; }
    10.     public string Level { get; set; }
    11.     public string DurationMinutes { get; set; }
    12.     public string PTCBio { get; set; }
    13.  
    14.     //Initializing the PartitionKey and RowKey values
    15.     public REEntry()
    16.     {
    17.         PartitionKey = DateTime.UtcNow.ToString("MMddyyyy");
    18.         RowKey = string.Format("{0,10}_{1}", DateTime.MaxValue.Ticks - DateTime.Now.Ticks, Guid.NewGuid());

    Context Class

    Here we will be defining the Context.

    Context Class
    1. /// <summary>
    2. /// Context Class to initialize the connection to the storage table
    3. /// </summary>
    4. public class REDataContext : TableServiceContext
    5. {
    6.     public REDataContext(
    7.         string baseAddress,
    8.         StorageCredentials credentials)
    9.         : base(baseAddress, credentials)
    10.     {}
    11.  
    12.     public IQueryable<REEntry> ReEntry
    13.     {
    14.         get { return this.CreateQuery<REEntry>("REEntry"); }
    15.     }
    16. }

    DataSource Class

    This will not only initialize the previous class but have those public methods by which we can add or access data from Azure Storage

    DataSource Class
    1. /// <summary>
    2. /// Initializing the DataSource with public methods
    3. /// </summary>
    4. public class REDataSource
    5. {
    6.     private static CloudStorageAccount storageAccount;
    7.     private REDataContext context;
    8.  
    9.     static REDataSource()
    10.     {
    11.         storageAccount = CloudStorageAccount.FromConfigurationSetting("DataConnection");
    12.  
    13.         CloudTableClient.CreateTablesFromModel
    14.             (
    15.                 typeof(REDataContext),
    16.                 storageAccount.TableEndpoint.AbsoluteUri,
    17.                 storageAccount.Credentials
    18.             );
    19.     }
    20.  
    21.     public REDataSource()
    22.     {
    23.         context = new REDataContext(
    24.                 storageAccount.TableEndpoint.AbsoluteUri,
    25.                 storageAccount.Credentials);
    26.         context.RetryPolicy = RetryPolicies.Retry(3, TimeSpan.FromSeconds(1));
    27.     }
    28.  
    29.     //Getting the existing values
    30.     public IEnumerable<REEntry> REEntries
    31.     {
    32.         get
    33.         {
    34.             var results = from c in context.ReEntry
    35.                             where c.PartitionKey == DateTime.UtcNow.ToString("MMddyyyy")
    36.                             select c;
    37.             return results;
    38.         }
    39.     }
    40.  
    41.     //Adding new row to the table
    42.     public void AddREEntry(REEntry newREItem)
    43.     {
    44.         context.AddObject("REEntry", newREItem);
    45.         context.SaveChanges();
    46.     }
    47. }

     

    Web Role

    Global.asax

    Global.asax
    1. void Application_Start(object sender, EventArgs e)
    2. {
    3.     CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetting) =>
    4.         {
    5.             configSetting(RoleEnvironment.GetConfigurationSettingValue(configName));
    6.         });
    7. }

    Default.aspx

    Default.aspx
    1. using System;
    2. using Microsoft.WindowsAzure;
    3. using ReadinessEventDBLibrary;
    4.  
    5. namespace Table_WebRole
    6. {
    7.     public partial class _Default : System.Web.UI.Page
    8.     {
    9.         public static bool storageInitialized = false;
    10.         public static object gate = new object();
    11.  
    12.         protected void btnSubmit_Click(object sender, EventArgs e)
    13.         {
    14.             InitializeStorage();
    15.  
    16.             //Initializing and adding an entry
    17.             REEntry entry = new REEntry() { Alias = txtAlias.Text, Agenda = "Agenda", DurationMinutes = "120", Level = "200", PTCBio = "Bio", TopicTitle = "Title" };
    18.             REDataSource ds = new REDataSource();
    19.             ds.AddREEntry(entry);
    20.             System.Diagnostics.Trace.TraceInformation("Partition Key : {0}, RowKey : {1}", entry.PartitionKey, entry.RowKey);
    21.  
    22.             txtAlias.Text = string.Empty;
    23.         }
    24.  
    25.         /// <summary>
    26.         /// Initializing the Storage
    27.         /// </summary>
    28.         private void InitializeStorage()
    29.         {
    30.             if (storageInitialized)
    31.                 return;
    32.  
    33.             lock (gate)
    34.             {
    35.                 if (storageInitialized)
    36.                     return;
    37.  
    38.                 try
    39.                 {
    40.                     var storage = CloudStorageAccount.FromConfigurationSetting("DataConnection");
    41.  
    42.                 }
    43.                 catch { }
    44.                 storageInitialized = true;
    45.             }
    46.         }
    47.     }
    48. }

    Checking it out

    Hit F5 to run the application but ensure that you are running Visual Studio 2010 in elevated mode.

    image

    Data can be visible from Server Explorer of Visual Studio 2010.

    image

    image

    A very special thanks goes to Azure Training Kit. Download it today and learn Azure, nothing better than this. Enjoy Windows Azure and keep programming for Cloud!!!

    Namoskar!!!

  • Wriju's BLOG

    TFS 2010 : Setting permission for a Branch

    • 0 Comments

    It is easy to set permission to a Branch for developers. This would allow us to ensure the activities they would be doing on that Branch like Merging, Unlocking, Undo Checkout etc.

    Right click on a branch and go to properties,

    image

    TFS 2010 Source control rocks.

    Namoskar!!!

  • Wriju's BLOG

    What’s new in Windows Azure

    • 0 Comments

    What’s new in Windows Azure which is coming up next? In PDC 2010 bunch of new features like,

    • Virtual Machine Role
    • Extra Small Instance
    • Virtual Network
    • Remote Desktop
    • Azure Marketplace

    And many more. To find more on it http://www.microsoft.com/windowsazure/pdcannouncements/

    I feel strongly that, with VMRole and Remote Desktop migration will be much more easier. We can install and configure 3-rd party components.

    Namoskar!!!

     

  • Wriju's BLOG

    Secrets of Effective Technical Talks

    • 0 Comments

    Presenting Effective Technical Talks http://www.msteched.com/2010/NorthAmerica/SIA334

    Namoskar!!!

  • Wriju's BLOG

    SQL Server Performance Tips

    • 0 Comments

    SQL Server Performance Series – Part 1 – Introduction to Performance Tuning

    http://www.msteched.com/2010/Europe/DAT340

    SQL Server Performance Series - Part 2 - Server and Database Tuning

    http://www.msteched.com/2010/Europe/DAT341

    SQL Server Performance Series – Part 3 – Query and Index Tuning

    http://www.msteched.com/2010/Europe/DAT342

    Namoskar!!!

  • Wriju's BLOG

    Batch Download PDC 2010 Session

    • 0 Comments

    If you are a developer PDC is for you and this PDC 2010 has a lot of things for a Developer. You feel boring while downloading one by one. Life is easy as another great developer wrote a tool to do it most elegantly.

    http://blogs.msdn.com/b/mark/archive/2010/11/03/pdc10-downloader.aspx?wa=wsignin1.0

    Once you have downloaded all of them you can rename them to most readable format at http://peterkellner.net/2010/11/04/pdc10-videos-renaming-script/

    List of all sessions are here http://peterkellner.net/2010/11/04/pdc10-videos-renaming-script/

    I must say that I never had such a pleasing experience downloading series of content like this.

    Namoskar!!!

  • Wriju's BLOG

    ADO.NET Entity Framework FAQ

    • 0 Comments

    Great set if ADO.NET Entity Framework FAQ at http://www.ef-faq.org/ 

    Namoskar!!!

  • Wriju's BLOG

    ADO.NET Entity Framework POCO Resources

    • 0 Comments

    Some of the available finest resources on POCO

    MSDN Articles

    Requirements for Creating POCO Proxies

    Loading Related POCO Entities

    Tracking Changes in POCO Entities

    How to: Define POCO Entities

    How to: Define a Custom Object Context

    How to: Customize Modeling and Mapping Files to Work with Custom Objects

    How to: Define a Custom Object Context

    How to: Create a POCO Entity with Proxies

    How to: Explicitly Load POCO Entities

    How to: Detect Changes in POCO Entities

    How to: Change Relationships Between POCO Entities

    ADO.NET Team Blog

    POCO in the Entity Framework 4 - Part 1

    POCO in the Entity Framework 4 - Part 2

    POCO in the Entity Framework 4 - Part 3

    Namoskar!!!

  • Wriju's BLOG

    Closing a Windows Form by pressing ESC key

    • 6 Comments

    While I was developing one Windows Forms application, it was required for me to close the popup forms when user will press ESC key. I tried adding the Form’s KeyPress event. It was not working as expected. Then I thought I should write a code to find all the controls to my form and add the KeyPress event programmatically. It supposed to be bad approach as it will trigger all the time.

    Then I found a very elegant way to achieve it. There is one property in Form class called CancelButton. So we need to add a button and code there to close it. After that add it as Form’s cancel button and done. But if you have written code to handle ESC key for any other control, this would not work.

    1. private void button1_Click(object sender, EventArgs e)
    2. {
    3.     this.Close();
    4. }
    5.  
    6. private void Form1_Load(object sender, EventArgs e)
    7. {
    8.     this.CancelButton = button1;
    9. }

    Namoskar!!!

  • Wriju's BLOG

    Learn Windows Phone 7 in 31 Days

    • 1 Comments

    http://www.jeffblankenburg.com/post/31-Days-of-Windows-Phone-7.aspx

    Day #1: Project Template
    Day #2: Page Navigation
    Day #3: The Back Button Paradigm
    Day #4: Device Orientation
    Day #5: System Theming
    Day #6: Application Bar
    Day #7: Launchers
    Day #8: Choosers
    Day #9: Debugger Tips
    Day #10: Input Scope (on-screen Keyboard)
    Day #11: Accelerometer
    Day #12: Vibration Controller
    Day #13: Location Services
    Day #14: Tombstoning
    Day #15: Isolated Storage
    Day #16: Panorama Control
    Day #17: Pivot Control
    Day #18: WebBrowser Control
    Day #19: Push Notification API
    Day #20: Map Control
    Day #21: Silverlight Toolkit
    Day #22: Apps vs. Games
    Day #23: Trial Versions of Your App
    Day #24: Embedding Fonts
    Day #25: Talking to Existing APIs (like Twitter)
    Day #26: Sharing Your App With Other Developers
    Day #27: Windows Phone Marketplace
    Day #28: Advertising SDK
    Day #29: Animations
    Day #30: Gestures
    Day #31: Charting

    Namosakar!!!

  • Wriju's BLOG

    Team Foundation Server 2010 on the Cloud

    • 0 Comments

    Today at Microsoft PDC 2010 Brian Harry showed a demo of TFS 2010 installed and hosted on the cloud. This is super cool stuff. Because you do not need to install and configure TFS 2010 on premises. Rather you provision the Team Foundation Server and just have your Visual Studio 2010 connected to it. More so, you can also let Yahoo, Google, Facebook connect to your TFS 2010 hosted on Cloud. So people can access using their Yahoo, Google or Facebook user id and password to connect to Team Foundation Server 2010 Hosted on Cloud.

    This will also allow you to connect using you domain account. Overall, its super cool stuff.

    Watch out more at Brian Harry’s blog for more on how Microsoft developed it http://blogs.msdn.com/b/bharry/archive/2010/10/28/tfs-on-windows-azure-at-the-pdc.aspx

    Namoskar!!!

  • Wriju's BLOG

    Visual Studio 2010 Keyboard Bindings

    • 0 Comments

    All the Visual Studio 2010 Keyboard bindings are available here for you to download. These are very helpful resources for a person who spends most of his days in Visual Studio. Go and grab it from http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=92ced922-d505-457a-8c9c-84036160639f 

    I personally like Ctrl+. which allows me to add the using statement without going to the top of the file. I use it quite frequently. 

    Namoskar!!!

  • Wriju's BLOG

    Installing TFS 2010 is very very Easy

    • 3 Comments

    Installing Team Foundation Server 2010 is as easy as Microsoft Office Installation. This is my second attempt to install single server TFS 2010. I am successful again.

    Few things we need to take care is

    1. Use the Team Foundation Server 2010 Installation Guide and follow it step by step at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2d531219-2c39-4c69-88ef-f5ae6ac18c9f&displaylang=en

    2. I had to ensure that it has IIS and .NET Framework installed from Server Role.

    3. I had installed Windows Server 2008 R2 and then installed SQL Server 2008 R2 Standard. I have installed it with all the component including SSRS and SSAS.

    4. Then I downloaded and installed Windows SharePoint Services 3.0 x64 with Service Pack 2 from http://go.microsoft.com/fwlink/?LinkId=148457. Follow the instruction.

    5. Finally I installed Team Foundation Server 2010

    image

    Once the TFS 2010 Installation is complete it asks for the configuration

    image

    Configure the Proxy

    image

    Then Build service

    image

    Last thing is the Sharepoint. Once over you are ready to go. What is most important is the easily approach and we do not have to think about it. Enjoy the ALM via Team Foundation Server 2010.

    Namoskar!!!

  • Wriju's BLOG

    Visual Studio 2010 Working Offline

    • 2 Comments

    Today I found one interesting stuff while I was away from corpnet and changing the source code. It was asking me to override while saving the file. I did it as because I had done some work there. Later when I was connected to the corpnet I right clicked and selected the option “Go Online”. All my changes are back to the source code. Very simple and convenient.

    image

    Team Foundation Server 2010 Source Control is simply amazing.

    Namoskar!!!

  • Wriju's BLOG

    LINQ : From Basics to Query

    • 0 Comments

    Many of us are aware of LINQ today. LINQ is an amazing programming language feature. During my discussions I find a lot of myths around understanding. Here I have tried to demonstrate from some basics of C# 3.0 language enhancements to delegate, anonymous type, lambda expression and finally LINQ. How it has evolved.

    image

    http://channel9.msdn.com/posts/LINQ-Evaluation-From-Basics-to-Implementation

    Namoskar!!!

  • Wriju's BLOG

    Entity Framework finding the differences between production database and model’s schema

    • 2 Comments

    We develop our ADO.NET EF model from the development environment db and then when finally run it to the production we might find that DBA might have added few rules or renamed the database columns. Then our application would start throwing errors. One easy way to get it rectified is to run query against each entity and catch if any error. Otherwise EF gives some public API to use.

    Background

    I have created my edmx from my dev database and it has just two columns.

    image

    Now at production let’s suppose my column is EmpNameTest. How can I programmatically check the difference?

    I was going through the tool EdmGen.exe and it gives us an option to validate via

    EdmmGen /mode:ValidateArtifacts /inssdl:Model1.ssdl /inmsl:Model1.msl /incsdl:Model1.csdl

    All the three files can comes from your edmx file. If you choose the option from edmx file to be part of your output directory, then it will same all of then individually to your output directory.

    image

    Now, I will generate the ssdl at runtime by reading the production database, this gets saved to my output directory.

    Create SSDL
    1. private static void CreateSSDL(string connStr, string provider, string modelName, string newSSDLFileName)
    2. {
    3.     IList<EdmSchemaError> ssdlErrors = null;
    4.  
    5.     // generate the SSDL
    6.     string ssdlNamespace = modelName + "Model.Store";
    7.     EntityStoreSchemaGenerator essg = new EntityStoreSchemaGenerator (provider, connStr, ssdlNamespace);
    8.     ssdlErrors = essg.GenerateStoreMetadata();
    9.  
    10.     // write out errors
    11.     if ((ssdlErrors != null && ssdlErrors.Count > 0))
    12.     {
    13.         System.Console.WriteLine("Errors occurred during generation:");
    14.         //WriteErrors(ssdlErrors);
    15.         return;
    16.     }
    17.  
    18.     essg.WriteStoreSchema(newSSDLFileName);
    19. }
    p

    Now call it from your method,

    1. string newSSDLFileName = "MyTestModel.ssdl";
    2.  
    3. //Create NEW SSDL at runtime
    4. CreateSSDL(myConnectionString, "System.Data.SqlClient", "Sept2010", newSSDLFileName);

    Then run the validate method as below,

    Validate
    1. private static void Validate(string newSSDLFile)
    2. {
    3.     //Reading SSDL from generayted file
    4.     XElement s = XElement.Load(newSSDLFile);
    5.  
    6.     //Reading CSDL and MSL from assembly
    7.     XElement c = XElement.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("Model1.csdl"));    
    8.     XElement m = XElement.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("Model1.msl"));
    9.  
    10.     // load the csdl
    11.     XmlReader[] cReaders = { c.CreateReader() };
    12.     IList<EdmSchemaError> cErrors = null;
    13.     EdmItemCollection edmItemCollection =
    14.         MetadataItemCollectionFactory.CreateEdmItemCollection(cReaders, out cErrors);
    15.  
    16.     // load the ssdl
    17.     XmlReader[] sReaders = { s.CreateReader() };
    18.     IList<EdmSchemaError> sErrors = null;
    19.     StoreItemCollection storeItemCollection = MetadataItemCollectionFactory.CreateStoreItemCollection(sReaders, out sErrors);
    20.  
    21.     // load the msl
    22.     XmlReader[] mReaders = { m.CreateReader() };
    23.     IList<EdmSchemaError> mErrors = null;
    24.     StorageMappingItemCollection mappingItemCollection =
    25.         MetadataItemCollectionFactory.CreateStorageMappingItemCollection(
    26.         edmItemCollection, storeItemCollection, mReaders, out mErrors);
    27.  
    28.  
    29.     // validate the mappings
    30.     IList<EdmSchemaError> viewGenerationErrors = null;
    31.     viewGenerationErrors = EntityViewGenerator.Validate(mappingItemCollection);
    32.             
    33.     if (cErrors.Count > 0 || sErrors.Count > 0 || mErrors.Count > 0 || viewGenerationErrors.Count > 0)
    34.     {
    35.         Console.WriteLine("Error Error!!!");
    36.     }
    37.     else
    38.     {
    39.         Console.WriteLine("No Error :)");
    40.     }
    41. }

    I found this solution from the EdmGen2.exe. You will find the whole source code available at http://code.msdn.microsoft.com/EdmGen2

    Two points before you try it out,

    • Add the assembly System.Data.Entity.Design from Windows\Assembly folder
    • Change the Edmx’s Metadata Artifact Processing property to Embed in Output Assembly

    Namoskar!!!

     

Page 9 of 24 (599 items) «7891011»