Friday 15 April 2016

Few Knobs & Dials Over WCF & Entity Framework.

     Hi everyone, we will see some few errors and their workarounds to fix those errors, which occur commonly while you building up a service layer using WCF with Entity Framework for data access.

Before moving to this topic, just a question for you, 

- Are You A PHONY?

     If your answer is No. Then, you have settled. Or you adjusted yourself, to the routine work, or you felt content with what you have learnt (No comments about you :P ).

     But if your answer is Yes.  Then continue reading.... :P

     Being a developer, that too, Full-Stack Developer (not Front or Back End, neither Client/Server Side) it's an End-To-End Development. Almost covers, 5 to 6 languages stack at the same time, it's OK, that you could google some time, but I'm sick of googling the topics, and copy paste the code, do some modifications to my requirements / issues. I'm doing this for half the decade... And the race is how fast you could google and resolve. 

     I'm trying to get rid of this, by practicing the following steps.

STEPS

1. For any issue, or exception arises, first don’t move your mouse to select the entire exception. And paste in Google. Instead read the exception fully first. 

2. Try to fix the exception, using your IDE itself. By trying few more options, like re-creating objects with additional parameters, or trying the same method with few additional parameters.... These small additional parameters, will close your exceptions, 
For Eg :
 1) 
DataAdapterObj.Fill(DataSetObj); // Fill the select query data, into the DataSet container 
 But if your query returning 50 million record, you could re-write the above line, to  
DataAdapterObj.Fill(DataSetObj,10000); // Fetches 10000 records at a time.

3. Exceptions doesn't get resolved by STEP - 2, Go to MSDN., read the namespace, along with methods, [strictly not google or stack overflow]

It's hard first, to stop googling and takes much time to resolve the issues, BUT everything comes by practice....

And to your phony problem, read this how-to-not-be-a-phony

Coming back to the topic,

Few Errors & their resolutions, while using EF & WCF were found here

At Last,

"You are no better and no worse than you actually are."

And

“No One Is Perfect In This World, All Were Nearing & Trying To Be Perfect.”


Happy Fixing Yourself :)


Friday 8 April 2016

You Should Be Working....

“It’s more important on What You Work rather than Where You Work 

     Before moving to this topic, let’s take a scenario: As this is starting of the month and you will be busy calculating your budget for this month, with Excel. I love using Excel for budget. May be if it is of last year or before, I’ll be saving my Excel in my mail’s drafts folder and I’ll continue to calculate later at my Office. But few months back, no more drafting of the mails, and no more office products. All that I need is my Live account, I could work with spreadsheet in Excel Online which will be auto-saved in my One Drive.
     
     In the above scenario, whether at Home or Office, you may not need of Office Software, but you may need the desktop for that continuous editing, or at least you should open of the spreadsheets by logging in again and again.

     Apple made this, little bit forward, that the apps installed will be aware about your work and it alerts you back, when you switch for the other device., technology used here is called "Handoff Technology" tagged under "Liquid Computing", not a magical one, but surely will be useful. Released with iOS 8 back in the year 2014. 

     Apps that support for Handoff are : Mail, Calendar, Messages, Notes, Remainders, etc.,

Conclusion: Even it's there in iOS, with certain limitations. But, the other giants Microsoft & Google are surely far behind in this area. The reason, MS has "Windows" but their mobile market yet to improve a lot. And the Google is having "Android" but not an fully fledged desktop OS.  

Happy Contd.., :)


     

Thursday 7 April 2016

2 Quick Errors & Solutions in SharePoint 2013.

     Hi all, in this blog I want to quickly describe about the 2 errors that I faced in this week in my "New SharePoint development". 

New??? 

     Ya, for almost 2 years I missed with SharePoint. I could tell you my career started by learning SharePoint only. Did vast development that includes, OOB features, Web Parts, Event Receiver, Service Applications. But for the bread and butter, I have switched off from it, but where ever went I wrote some code to handle file upload/download into the SharePoint document library.  But the core development has missed. You can't work with SharePoint as a side kick project at your home, unless you were developing an Enterprise Application. So, I always have deep pain of missing this application framework.

You could ask me, What's so special in that?

For an End-User view, it's a document storage repository, again for web designers, its a Content Management System and for Developers it's a HELL. (all the time to dealt with the Correlation-IDs, URLs, :P )

According to me, it's an 

 "Application Framework".

You may all know that Frameworks makes the Developer's Life Easy. Same way, if you want to develop an application, without writing tons of codesyou could achieve the other subsidiary modules apart from your own business logic, sometime it could finish module for your business needs if they are more general. Some of the basic app needs that could be addressed by SP,

1. User Management - Served via User Profile Applications.

2. Document Management - Microsoft's office integration, with versioning in form of Document Library.

3. Search - Can configure Search Services [Fast Search].

4. Business Workflow - SP Workflows will do the needful.

And much more....

Let's move to the topic:

Error 1: While running your SharePoint solution, using VS. You may see the following error, sometimes,

Platform Not Supported Exception
Solution

1. Right click your solution, on properties page, turn your build Platform Target to Any CPU or X64.

2. Else, from VS Tools menu, go to Options, set the VS to use 64-bit IIS Express, like below.



Error 2:

      On writing code, for the SharePoint List Item: Insert / Update "The security validation for this page is Invalid. Click back in your web browser, refresh the page, and try your operation again".

Solution

Maintain your locks., properly..

currentWeb.AllowUnsafeUpdates = true;
// update your items.
currentWeb.AllowUnsafeUpdates = false;


Happy Coding :)