Advertuse

Search This Blog

Your Ad Here

Wednesday, 29 June 2011

When your client will concern about his db password


Hi friends,

When you get a client who is more technical ,then it accentuate on safety of his critical data. Recently I faced such type of client. When my client went through publish asp.net project on server and he found that our db password inside  web.config ‘s connection string , and  expressed his concern for  it safety of db password. so   he suggested me not to  placed in web.config moreover he asked me to  hardcoded that password in my asp.net code and obfuscate that dll..!!.

Monday, 27 June 2011

Atom v/s RSS

Hi friends,
  to follow's  our favorite blogs or websites, usually we subscribe Atom or RSS feed  provided by those blogs or  websites. so one should  know the difference  and similarity between them

.: Forget '.com', are you ready for '.google', or '.b...

.: Forget '.com', are you ready for '.google', or '.b...: "Think of it as a cyberspace land rush, as companies and others try to stake claims to websites ending with names like '.bank' Come next yea..."

compile by
Divyang Panchasara
Sr. Programmer Analyst
Hitech OutSourcing

Sunday, 26 June 2011

GUIDs (Globally Unique Identifiers) in .NET




Hi Friends,

GUID is frequently used in .NET and  SQL database system to set uniqueness of record or object.  And my friend  Priyank has  describe GUID very nicely in his latest post on his blog so I have repost  it here. you may like it. and you can refere his blog by clicking his  name to read  full blog.

Saturday, 25 June 2011

Validation in HTML5 without JavaScript

Hi Friends,
any website or web page which  allowed to fill data,  should have  client side as well as server side validation  for those entered data. hence in any website  client side  validation is done by JavaScript only. but in  HTML 5  now we can do validation without JavaScript.

 
you can have required  filed  by providing  required  attribute to those input type as shown below.


 <input type="email" required/> where required will indicate that a value must be supplied
images/forms_validation_required.png


S
compile by
Divyang Panchasara
Sr. Programmer Analyst
Hitech OutSourcing

Thursday, 23 June 2011

EB algorithm for Azure Database connection

Hi Friends,
As cloud computing  buzzing now days, so I spend my spare time to do some hand-on code for Window Azure using trial pass and reading related blogs for that
  Then during  my hand-on , once I face the problem of frequent connection failure due to  my Azure db was unavailable for few seconds .

extention method for IComparable<T>


hello friends,
 C# 3.0 gives great feature of extension method. so i keep playing with this. today  I would like to show you something interesting way to use that extension method. This time it's extending IComparable. The API signature for IComparable<T> has been around since the birth of  C language . If the left is less than the right, return something less than 0, if left is greater than right, return something greater than 0, and if they are equivalent, return 0. Well, its readability leaves a bit to be desired.
So I wrote this set of extension methods for any type T that implements IComparable:

Dispatcher A good tool for threading in WPF Part -I


Hi friends,
In my career I  had come across many good looking desktop application in which user do some click or tap his/her figure on screen for certain task and it becomes  “not responding  status”  due to long running  tasks. This type of Painful user experience makes application unsuccessful.
Means responsiveness of your application make difference. Hence developer should use threading in their application with some care to make more responsive application. In older .net (winform ) we have background work and threadpool to do  threading. Now in WPF we got another feature named dispatcher which makes your threading  work more easy hence you can make your WPF application better when you have  long running task in you  WPF screen .

 Long-running processes are involved—whether getting large results from a database, making async Webservice calls, or any number of other potentially intensive operations makes our application more unresponsive so we need to make it responsive to make your end  users much happier in the long run. But before you can start using an async programming model in your WPF app, it is important that you understand the WPF threading model. In this blogI will not only introduce you to that threading model, but I'll also show you how the Dispatcher-based objects work and explain how to use the BackgroundWorker so that you can create compelling and responsive user interfaces(i  will do in next blog)

Wednesday, 22 June 2011

Monthwise report With Pivot Query

http://impulsecode.blogspot.com/2011/06/monthwise-report-with-pivot-query.htmlhi Friends,

Today I come arcross a very nice  dyanmic  query example  on Priyank's  blog. So I would like to repost same  details  here

Impulse Code: NEWID() - Generate Randomly Sort Records - TSQL

Impulse Code: NEWID() - Generate Randomly Sort Records - TSQL: "In our company, we have project for 'Quiz management'. On quiz page, we have to fetch 10 random question from large table. To get a..."

compile by
Divyang Panchasara
Sr. Programmer Analyst
Hitech OutSourcing

Tuesday, 21 June 2011

how to make comman control event for all child control of container

Hi friends
so time in my winform base project, I get scenario where the requirement was to assign a click event handler to all child/dynamic Controls contained in a .NET User Control. This is a simple technique but I found there was no good documentation on how to do this.

Monday, 20 June 2011

Visual studio trick and tips

Hi friends,

Today I would like to discuss some tricks that visual studio provided to increase my productivity

Tip #1 – You don’t need to select a line to copy or delete it

I always cringe whenever I see someone select an entire line of code in the Visual Studio code editor before copying the line or deleting the line (see Figure 1). You don’t need to do this.
Figure 1
image
f you want to copy a line of code then you can simply press CTRL-c to copy the line and press CTRL-v to paste the line. If you want to delete a line, don’t select it first, just press CTRL-x. You’ll be surprised how much time this one tip will save you.

Code Impulse: TSQL - Decimal to time

Code Impulse: TSQL - Decimal to time: " Yesterday I got one query to change numeric value to decimal value. Suddenly I thought 'Are datetime and numeric value convertible?' like..."

compile by
Divyang Panchasara
Sr. Programmer Analyst
Hitech OutSourcing

Tuesday, 14 June 2011

display https page in iframe of http

hi guys  in you website if you want to do some secure payment  and you also want to show http  in  adressbar then  how will you do...?
 well  iframe will come to your help. it is quite easy.  develop you site like this

<html>
<head>
</head>
<body>
<div>
Lorem ipsum <br/>
Lorem ipsum <br/>
Lorem ipsum <br/>
</div>
<iframe src="https://www.youdomain.com/yousecurepage.aspx" width="100%" height="600" scrolling="auto"> </iframe>
<div>
Lorem ipsum <br/>
Lorem ipsum <br/>
Lorem ipsum <br/>
Lorem ipsum <br/>
</div>
</body>
</html>

you can see following link  and  and see the view source then you can find that  it will works and in all browser..!!!

http://www.clevelandutilities.com/obppay.htm




compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Monday, 13 June 2011

move ViewState to bottom of Page in ASP.NET

on last Saturday, in Community tech days Tejash Shah has discussed  about  viewstate's  prons and crons.  in his wonderful session and also give hint  that if you want to move your viewstate at bottom of  page to  load  page faster in ur browser then you can do it .
so question is   how to move  viewstate in bottom.....??...  for that we have to override render event of  page and put below code you can move your page's  viewstate  at bottom of your page.

       protected override void Render(System.Web.UI.HtmlTextWriter strwriter)
        {
        
                System.IO.StringWriter strWriter = new System.IO.StringWriter();
                HtmlTextWriter objhtmlWriter = new HtmlTextWriter(strWriter );
                base.Render(objhtmlWriter);
                string newhtml = strWriter .ToString();

                  int SPt = newhtml.IndexOf("<input type=\"hidden\" name=\"__VIEWSTATE\"");
                 if (SP >= 0)
                {
                    int EP = newhtml.IndexOf("/>", SP) + 2;
                    string viewstateInput = newhtml.Substring(SP, EP - SP);
                    newhtml = newhtml.Remove(SP, EP - SP);
                    //int FormEndStart = newhtml.IndexOf("") - 1;
                    int FormEndStart = newhtml.IndexOf("");
                    if (FormEndStart >= 0)
                    {
                        newhtml = newhtml.Insert(FormEndStart, viewstateInput);
                    }
                }
                writer.Write(newhtml);
          

        } 

and  if you want to see demo  application you can download from here which made using  scottes blog

File name: ViewstateDemo.zip
File size:20.79 KB




compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Sunday, 12 June 2011

PHP on Windows and SQL Server Training Kit

Hi friends,
just now I come across with Pinal's Blog and I found  one interesting  small blog regarding  a toolkit available to develop application using PHP  for IIS 7.5  and SQL server 2008 R2.

Pinal Dave's Blog Link


The PHP on Windows and SQL Server Training Kit includes a comprehensive set of technical content including demos and hands-on labs to help you understand how to build PHP applications using Windows, IIS 7.5 and SQL Server 2008 R2. This release includes the following:
PHP & SQL Server Demos
  • Integrating SQL Server Geo-Spatial with PHP
  • SQL Server Reporting Services and PHP
PHP & SQL Server Hands On Labs
  • Introduction to Using SQL Server with PHP
  • Using SQL Server Full-Text Search and FILESTREAM Storage with PHP
  • New: Getting Started with SQL Server Migration Assistant for MySQL




compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

ASP.NET 4.0 Active MarkUp v/s Passive Markup , Part-I

ASP.NET  4.0  gives us two main flavor of programming  style.  Active Markup and Passive Markup.
ohh..!! what is this  new  terminology Active Markup and Passive Mark Markup.. ?!!!.  This  term you never find on msdn or any Microsoft Evangelist's  blog or book.  this is new term coin by me for  ASP.NET webform and ASP.NET MVC..

asp.net webform  v/s

  why I have used this new term to make things more messy...!!! ...well I have used this terms to make things much easier to understand ASP.NET MVC  if one has knowledge of ASP.NET Webform programming and page life cycle.
So lets go back to our understanding of ASP.NET Page and it's Life Cycle.
normally in ASP.NET we have page name .aspx  and their code behind  .aspx.cs or .aspx.vb . In asp.net page we usually write html markup and server control markup like <asp:bla runat="server" >...</asp:bla> ...... in sort  .aspx page is nothing but the a markup page.
 Similarly  in MVC we also have .aspx page and those are called view pages  and  in those  .aspx page we wrote html (means  markup code) and wrote some binding  to those html with model entity and  if we are using razor view engine then we may have .chtml file which is again  have  html and their  binding with model entity. means  view are nothing  but the  markup pages. hence in both  programming framework we have markup pages where we write our UI as markup..
But, both framework  while request is processed, they handled Markup in different way to generate response . in WebForm markup page comes first to process  while in MVC  markup page come at last to process hence  webform is  ActiveMarkup and MVC  is PassiveMarkup.

ASP.NET  Webform.
when user request  http://somedomain.com/somepage.aspx then IIS server will search somepage.aspx file in virtual directory where your webproject is placed. means  request  1st comes to  your aspx page then from  page directive it will find out  which  page class(code behind) need to execute. hence your markup page process request before the their cod behind (actully this code behind  reside(after compiling and publishing)  in  .dll file  and this dll file reside in bin ) so I called  as Active Markup page framework.

ASP.NET MVC

when user request  http://somedomail.com/home/about then as per  configuration of routing table  Server search a class named HomeControler(derive from controller class) of  dll reside in bin. and  inside that it will serach public function name about  and handover  this request to this function. now  this  function will process this request and then  call  approprivate view(markup) file and finally generate response. so markup page come last so I called as Passive Markup page framework.




compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Friday, 10 June 2011

Thursday, 9 June 2011

OOPs

Object Oriented Programing is common practice in modern software development. So any beginner developer  must know what it is and should be able to explain certain terms which  is  used in .NET a object oriented programming  platform .  
  • Classes
  • Properties
  • Methods
  • Fields
  • Members
  • Enums
  • Casting
  • Structures
  • Abstraction
  • Encapsulation
  • Interfaces
  • Static classes
  • Constructors
  • Method overloading
  • Inheritance
  • Overriding methods
  • Virtual methods
  • Abstract classes
  • Polymorphism
  • Delegates
  • Events
  • Assemblies
  • Namespaces




  • What is a class?
A class is an abstract concept. It is a blueprint. Try to think of a class as e.g  the blueprints of a car in the real world.
The designers of auto mobiles sit in front of their computer (or use paper and pencil) and describe exactly the parts of the auto mobile. They describe how these parts interact, the colour of the car, the height of the car, the size of the engine, the acceleration of the car, if the car has air-conditioning system installed.
Then the mechanics that observe the production line, make sure that the cars built (the actual cars) follow the blueprints outlined in the design stage of building a car.
So a class is a way of describing real world entities. It is the code definition for objects.
The class is the fundamental building block of code when creating object-oriented software. A class describes in abstract (in theory) all of the characteristics and behaviour of an object.
The object on the other hand is the instance of a class. The real thing, if you excuse my slang…
So we must start thinking about modelling our applications in terms of objects.
When someone, who has hired us to implement a web site-commerce site for his business, he could outline his view of the web site in plain words…
” I would like to have a site where I can keep track of the sales-orders that were placed through the site. I also would like to be able to see the customer details and manage my employees details”,
Then you must think in terms of Orders,Customer,Employee classes-objects for this particular scenario.
This is a first attempt of Abstraction for the scenario above.
Abstraction is the process of representing simplified versions of real-world objects in your classes and objects.
Programming with the OOP paradigm is to decide what a class should represent and breaking down your code into a group of interrelated classes.
Members of a class
The first thing after finalising the class names is to identify the members of a class.
I will talk about Propertiesmethods and events. As we go on I will talk in greater detail about class members.
  • What is a property ?
A Property allows you to access an object’s data. Properties can be read-only, so they cannot be modified, while others can be changed. A Property defines the state of an object.It describes its individual data or unique configuration.
  • What is a method ?
A method allows you to perform an action with an object. Unlike properties, methods are used for actions that perform a distinct task and may  change the object’s state-property.
  • What is an event ?
An event provides notification that something has happened. Objects can fire events to trigger the code we have placed in the event-handling routines-methods. For example, if a user clicks on a button,the button object fires a Click event, which our code can react to.
Methods, properties and events can be considered as the public interface of a class.
Now we are ready to move on and practice what we have been saying so far.
I assume that people who will read this post, have some experience with C# and Visual studio as a development platform.
I will use Visual Studio 2008 Professional edition. People who have downloaded and installed Visual web developer 2008 can also follow these examples. You can download Visual Web Developer by clicking here .
I will create an ASP.NET application. I will create a base class and then take it from there and try to highlight all the concepts mentioned above. The point of this example is not create super sophisticated classes and methods but to create a simple class with plain properties and methods.
1) Launch VS 2008
2) Go to File->New->Project
3) From the templates, choose ASP.NET web application. Make sure you select C# as the language of development
4) Give a name for your project. I name it “LearnCLass”. Click OK on the Templates window.
5) You will have 2 main files, Default.aspx and Default.aspx.cs

download Ebooks Part -I

Microsoft Expression Blend


Hi guys  expression blend is  is a user interface design tool developed and sold by Microsoft for creating graphical interfaces for web and desktop applications that blend the features of these two types of applications. It is an interactive, WYSIWYGfront-end for designing XAML-based interfaces for Windows Presentation Foundation and Silverlight applications. It is one of the applications in the Microsoft Expression Studio suite


you can download  from here

File name: Blend_Trial_en.exe
File size: 93.27 MB



compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Wednesday, 8 June 2011

કલાઉડ કોમ્પુતિંગ

આજ કાલ કલાઉડ કોમ્પુતિંગ  શબ્દ પ્રોગ્રમ્મેરો  ના  મોઢે ઘણો  સાંભળવા મળે છે . કારણકે  window  Azure  અને icloud  દ્વારા microsoft  અને Apple  આ  માર્કેટ માં  પગ મૂકી રહ્યા છે .
તો શું છે આ કલાઉડ કોમ્પુતિંગ  ?
 કલાઉડ કોમ્પુતિંગ  એટલે  internet  બેઝ  સર્વિસ  જેમાં યુઝર લોકલ PC ના બદલે તેનો Data  કમ્પ્યુટર નેટવર્ક   માં  Save  કરે અને  કમ્પ્યુટર નેટવર્ક દ્વારા અપાતી   સોફ્ટવરે સર્વિસ  તે PC માં  minmum  installation   અથવા No installation  વડે કરી શકે

 કલાઉડ કોમ્પુતિંગ ને  મુખ્યત્વે  ૩ પ્રકાર માં વહેચી શકાય.

  1. IaaS
  2. SaaS
  3. PaaS
 


compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Cloud computing Classification

Cloud Computing  is buzzing word  now a days , for techyes. due to  Azure and icloud . but clould computing exist  since long time

. and  it can be classified  base on what type of service  it offers to user. here are there  classification of cloud computing.
  1. IaaS
  2. SaaS
  3. PaaS
  
  1. IaaS :  Infrastructure-as-a-Service
      means provider provides  web hosting and/or  virtual machines with fixed number of CPUs, fixed amount of RAM and hard disk space. And these virtual machine can run window , MAC server  or Linux like OS.
    All the system services that make up the foundation layer of a cloud  are IaaS. Hence  network service and data-backup are also consider as part of IaaS.
    Savvis, GoGrid.com, Rackspace, ATT Cloud Service  are nothing but it is IaaS.
    hence  IaaS means  provider gives  Virtualizations Infrastructure This service is mainly access by Newtwork architecture and/or network maintenance User 

  2. SaaS : Software-as-a-Service
    means Provider provides a hosted services which has many servers across the globe and  this services are means for certain business function or for  specific consumer market like Gmail, Hotmail, FaceBook, SalesForce.com. etcs.
    hence SaaS means
    Dedicated Software Application Services
    This  service is  meant for End user person.

  3. PaaS: Platform-as-a-Service
    means Provider 
    enables development of cloud-based application service on that platform through specific API/Services. The underneath platform might utilize virtualization infrastructure and uses proprietary software to distribute and manage the computing across wide range of computers and infrastructure  you can build, modify and deploy  cloud optimized application.  In short PaaS means  development  platform for cloud  application development.
    WindowAzure, icloud are example of PaaS.
    hence PaaS means Development platform for Cloud This service is meant  Cloud base software  developer.




compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Tuesday, 7 June 2011

Privew of Windows 8:







 Microsoft  come up with radical changes  in it's new OS named  Window 8.


This  OS  is made for ranging from  small device to  PC to big touch screen device. It is touch centric OS..!!. and this could be the answer of iPad 's iOS4 and iOS5.!!! another  strong reason for this  is, this OS will work on  System on a Chip (SoC) Architectures from Intel, AMD and ARM( ya.. on   ARM process it will also work..!!!). So this OS  could be turning point micrsoft OS history  as  window95 did  15 yrs back.. and NVIDIA, Qualcomm and Texas Instruments have joined Microsoft in this technology to demonstrate  window 8 preview on ARM Processor.
some of the features reveal in window 8 preview.


Fast launching of apps from a tile-based Start screen, which replaces the Windows Start menu with a customizable, scalable full-screen view of apps.
Live tiles with notifications, showing always up-to-date information from your apps.
Fluid, natural switching between running apps.
Convenient ability to snap and resize an app to the side of the screen, so you can really multitask using the capabilities of Windows.
Web-connected and Web-powered apps built using HTML5 and JavaScript that have access to the full power of the PC.
Fully touch-optimized browsing, with all the power of hardware-accelerated Internet Explorer 10.





compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing

Saturday, 4 June 2011

.NET Project's Target Platform x86 or x64 or AnyCPU


With 64 bit versions of Windows fast becoming the standard it is imperative that an app work in both 32 bit and 64 bit environments. This done using a basic configuration setting, with a few caveats of course. In Visual Studio in the project’s build options you can select the app’s Platform target, which can be x86, x64, Itanium, or Any CPU (the listing you see may vary, depending on what you have installed with Visual Studio).















Since .NET assemblies consist of byte code that is  JIT (just-in-time) compiled to the current platform at runtime, an app’s assemblies will function on any architecture without needing to rebuild from the source code.
However, the choice is not always that simple. If your .NET assembly references or interops with another managed assembly or an unmanaged DLL which was compiled for a certain architecture, then your app’s .NET assembly will need to match the assembly or dll’s.
Take for example a scenario where you  have the following:
  • .NET assembly: Any CPU
  • 32-bit COM component
On a 32-bit OS this scenario will work fine since the .NET assembly will be JIT  compiled as 32 bits. However, this will fail on a 64-bit OS since the .NET assembly will be 64 bits and when it attempts to call into the COM component the app will break. In such a scenario, it best to specify that the assembly should always be 32 bit.
Note that x64 OSs  run 32-bit processes just fine. Also bear in  mind  that while .NET itself mostly insulates you from platform architecture considerations, when you using unsafe code, pointers, or relying on the size of IntPtr, you will likely encounter issues when running on multiple architectures.


compile by Divyang Panchasara Sr. Programmer Analyst Hitech OutSourcing