Jul 9, 2011

Using StringFormat for Binding in Silverlight: Viral Rathod

Dear Friends,

While, doing an optimization of our product, with my colleague RamKrishn Saini, we found some interesting stuff for Rapid coding and Performance in Silverlight 4.0 Application.

While Binding the DataGrid, inside a Text Column, we have previously used Converters, to Create our Require Date format inside our application. Which had consumed Time for coding and Performance of application as well.

i.e.,

XAML CODE:

<TextBlock Text="{Binding ENTRY_DATE,Converter={StaticResource ConvertFormatDateTime}}" / >

Code behind for Converter:

public class ConvertFormatDateTime : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null)
{
if (value.ToString().Contains("1/1/0001") || value.ToString().Contains("1900"))
return "-";
else
return System.Convert.ToDateTime(value).ToString();//("dd MMM yyyy hh:mm:ss");
}
else
return "";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}


Output: 05 Jul 2011 5:37:22

Now,
Using String Format it very Easy to code which is as follows:


i.e.,

XAML CODE:

<TextBlock Text="{Binding Path= ENTRY_DATE,StringFormat=f}" />

Output: Tuesday, July 05, 2011 5:37 PM

==================================================
CONCLUSION
==================================================

No need to code more, just in Single line reflection, Following are some other formats for Date Time:

StringFormat=f : “Saturday, April 17, 2004 1:52 PM”
StringFormat=g : “4/17/2004 1:52 PM”
StringFormat=m : “April 17”
StringFormat=y : “April, 2004”
StringFormat=t : “1:52 PM”
StringFormat=u : “2004-04-17 13:52:45Z”
StringFormat=o : “2004-04-17T13:52:45.0000000”
StringFormat=’MM/dd/yy’ : “04/17/04”
StringFormat=’MMMM dd, yyyy g’ : “April 17, 2004 A.D.”
StringFormat=’hh:mm:ss.fff tt’ : “01:52:45.000 PM”


MDSN article for standard date formatting

MSDN article for custom date formatting

Thanks, for Reading this post. I will bring some more live scenario interesting facts soon.

May 31, 2011

Silverlight 4 Application Development MCTS S70-506 Exam

MCTS 70-506 (Silverlight 4 Application Development)

http://www.blogger.com/img/blank.gif
Microsoft Silverlight is widespread application development platform, the recent version 4 release adding to its efficiency. The technology has emerged considerably fast since its introduction in 2007. An enormous number of Silverlight certified, cert seekers as well as organizations' adoption of technology speak volumes about its future standing among the development platforms. Besides rich, immersive features that it renders make it securer option in certification.

Available in just English language, 70-506 exam (proctored) was released in January 2011 for Microsoft Silverlight developers. The candidates have experience with Silverlight and Microsoft.NET development and with consuming data services. The exam measures your capabilities in the following areas:

Arrange content with panels, implement and configure core controls, create user controls, implement a navigation framework, display collections of items, play media files, create or modify control styles, create control templates, create or modify data templates, manipulate visuals, animate visuals, implement behaviors, manage the visual state, handle events, consume services asynchronously, work with background threads, work with dependency properties, interact with attached properties, implement iCommand, format data, implement data binding, create and consume value converters, implement data validation, implement the printing API, create out-of-browser applications, access isolated storage, interact with the HTML DOM, access the clipboard, read from and write to the host file system, handle alternative input methods, create and consume resource dictionaries, implement localization and globalization, handle application-level events, configure the Silverlight plug-in, dynamically load application resources, and create a client access policy.

Good knowledge about the above fields will lead to successful certification attempt bringing you the title of Microsoft Certified Technology Specialist (MCTS: Silverlight 4, Development). As of achieving the desired level of expertise, the choices may seem plenty, Microsoft 70-506 exam training, course books, e-learning resources, for instance, as well as self-paced tools available across the web. But it requires more than just sticking to one of these options to be able to clear 70-506 exam and actually benefit from your MCTS certification. Microsoft classes and courseware cost high and in wake of the expenditure most of the exam takers tend to look for online materials including questions and answers, practice test, study guide, preparation labs, audio and video exams in order to secure their success.

This is now a known fact that even those cert seekers who participate in IT exams, in general, and Microsoft 70-506 exam, in particular, take the aid of online learning and assessment resources to succeed on the first try of their exam.

There are some good reasons behind the phenomenon: reduced cost and study that it takes into it being the killer features, more suited to the hectic professional routines and tight economic conditions. Interactive software not only offers key materials to master the Silverlight (Microsoft 70-506) exam fundamentals but also keeps track of whatever you've learned from other sources. Plus, accurate evaluation in real-time environment, real PDF questions and answers, and expert instructions that these self-paced training tools render are to help aspirants achieve one projected goal-valuable success on the first attempt.

http://www.selfexamengine.com/

Article Source: Click Here

Apr 21, 2011

Release of Silverlight 5 Beta (13th April 2011)

On 13th April 2011, At MIX11, Scott Guthrie proudly announced the availability of Silverlight 5 Beta.

Following are some Enhanced features of Silverlight 5 Beta as Compared to Silverlight 4:
Multiclick support
Implicit data templates
Debugging inside binding in XAML
GPU-accelerated XNA-compatible 3D
Low-latency sound effects and WAV support
Real operating system windows and multi-display support
Many other Issues Resolved from SL3 & SL4

For, brief about Silverlight 5 Beta Following will be a good link:
Rapid Start
Form Discussion


For Installing Silverlight 5 Beta on your PC:
1. Visual Studio 2010 Service Pack 1 click here
2. Microsoft Silverlight 5 Beta Tools for Visual Studio 2010 Service Pack 1click here

Yet, the Date for Final release of Silverlight 5 is not declared, but its set to Release on second half of 2011 or upto the End of 2011.

Further more stuff, like tutorials and helps I will be posting later on.
Till then enjoy guys.

Mar 9, 2011

Configuring SSRS

Hi to all friends,

Well, due to a special request from a special friend I felt to put SSRS stuff over here.

What this Post contains
While integrating SSRS Report, the report.rdl file is loaded inside ReportViewer Control but, An issue occurs, that the report asks for Credentials Every Time.
This post contains C# code which can set Credentials dynamically from Web.config which may resolve the issue.


Prior Knowledge Required
To go through this Post, a programmer requires a prior knowledge of SSRS Reports Developing and Deploying.
[Its consider in prior that A Programmer is aware about 1),2),3),4) & 5) Points]

1). MIS.rdl File is uploaded over SSRS.

2). form_Report_Stock.aspx & form_Report_Stock.aspx.cs Both Page are well coded including ReportViewer Control.

3). form_Report_Stock.aspx.cs
using Microsoft.Reporting.WebForms;

4). form_Report_Stock.aspx
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>


5). form_Report_Stock.aspx.cs
Inside Page Load event of write following code:

if (!IsPostBack && !IsCallback)
{
List parameters = new List();
parameters.Add(new ReportParameter("P01Name","P01Value"));
parameters.Add(new ReportParameter("P02Name","P02Value"));
parameters.Add(new ReportParameter("P03Name","P03Value"));
parameters.Add(new ReportParameter("Connection_String",str_Cn)); //P04Name may Contain Connection String
ReportServiceUtilities.PrepareReport(rvControl,"Report_Name", parameters);
}

You need to download the ReportServiceUtilities.cs Class.

Also, Note to confirm following settings over SSRS:

1


2


3


4


Conclusion:
You will be able to set the SSRS Report Credentials Dynamically.

For any doubts please Leave comments,
I will try to revert ASAP for any issue.


Thanks!!

Mar 2, 2011

Tata Power may commission first unit of Mundra project by Sept
BS Reporter / Mumbai December 18, 2010, 0:35 IST

Tata Power is all set to commission the first 800-Mw unit of India’s first ultra mega power project at Mundra in Gujarat by September 2011.

Coastal Gujarat Power Ltd, the special purpose vehicle implementing the 4,000-Mw (5x800-Mw) project, had completed 65 per cent of the work, the country’s largest private sector power utility said in a recent analyst presentation. About 11,000 people are working on the site to meet the deadlines.

Erection of boiler pressure parts for the final three units and work on chimneys and 400-Kv switch yard are proceeding as per schedule. Structural fabrication of external coal handling system is 85 per cent complete, but requires diversion of a village road to complete the remaining work. Coal jetty with ship unloading facilities is expected to be ready this month.

Distributed control system switch on and boiler hydro testing of the second unit were successfully completed in September. Work is in progress on the 400-Kv power evacuation lines and efforts are on to obtain the required right of way in time for one of the sections of the line.

Tight project timelines for transmission and generation commissioning and smooth coordination across multiple vendors on site will be crucial to the project progress, said Tata Power.

After the commissioning of the first unit in September, the company hoped to commission the remaining four units at an interval of every four months, said Tata Power.

Out of the total project cost of Rs 17,000 crore, Tata Power had invested Rs 5,816 crore as debt and Rs 2,937 crore as equity investment till the second quarter of 2010-11. The project is funded on a 75:25 debt-to-equity ratio by a consortium of banks, including State Bank of India, International Finance Corporation, Asian Development Bank, KEIC and K-Exim.

The imported coal-based project requires 11-12 million tonnes per annum (mtpa) coal and Tata Power has off-take agreements for about 10.11 mtpa with KPC and Arutmin mines of Bumi resources, in which the company had picked up stakes a few years ago. The company is also scouting for additional mines in Australia, Mozambique and South Africa.

Tata Power has also floated a shipping subsidiary, Trust Energy Resources, with base in Singapore for owning ships to meet shipping requirements and trading in fuels. Another subsidiary, Energy Eastern, was also floated for chartering of ships. It is estimated that the Mundra project will require eight vessels to ship coal. The company has purchased two Korean-build vessels scheduled for delivery by 2011 and has already chartered three vessels to import coal from Indonesia.

Android 2.2 Froyo Web Browser Issue Resolved

Hi, Friends,
This is for Android 2.2 Froyo OS Users
Especially for,
LG Optimus One (Android 2.2) Mobile Users
TATA DOCOMO Sim Card

I have both Wi-fi Internet & GPRS (2G) Internet facility on my cell (Above mentioned).
Once I have by mistake kept both Net Using functionality on.
From that day, there was an issue inside the Web Browser, which was not able to connect to Internet using GPRS(2G), Although it was working fine with Wi-Fi connection. I was looking for its solution since few weeks but in vain.

Many fake stuff found were:
Browser Setting Issues, Tata Sim Card Net usage Finished, Some Network Coverage Issue,
Need to Reset mobile, Change factory Settings.


Finally I got the Solution
From Combine efforts of Mine & One good fellow (Dharmeshbhai, Nokia Priority, Poddar Arcrade), I got the solution as: Inside Settings->Wireless & Network Settings->Mobile Networks->Access Point Names->Reset to default
took 30 seconds of process and then Done as and when I started my Web Browser of LG Optimus One.

Hope this might be helpfull for other Android(2.2) Froyo LG Optimus One Web Browser Users.

Regards,
Viral Rathod
(Mo. 09725116400)