Saturday, April 27, 2013

Custom Paging in gridview in Sql server 2000

Declare @PageSize int,
@Page int,
@Segment varchar(10)

Set @PageSize=100
set @Page=3
Set @Segment='N'

---Logic to Find Total pages---
Declare @TPages int
Select @TPages=Case When Count(*)<=@PageSize Then 1 when (Count(*)%@PageSize)!=0 then (Count(*)/@PageSize)+1 Else (Count(*)/@PageSize) End
from tblname where Segment=@Segment
Print @TPages

-----Logic to Get Rows as per selected Page------
SET ROWCOUNT @PageSize
Declare @Sql varchar(8000)
set @sql='Select * from
(
      Select top '+Convert(varchar,(@Page*@PageSize))+' * from tblname where Segment='''+@Segment+'''
      order by ID
)a
order by ID desc'

Exec(@Sql)
SET ROWCOUNT 0

Tuesday, April 23, 2013

Four cloud tools to use for app development

It has been a constant struggle for app developers to write server-side code that allows for payments to be accepted. The time spent writing code and integrating it with the application can almost be a separate development phase in which the developer uses cross-development platforms that translate the code into a language Android and iOS can understand. The recently announced partnership between Parse and Stripe resulting in a joint platform seems to provides a reprieve from this struggle.

Stripe has been a hit with developers since 2011 because of its simplicity in setting up merchant accounts and linking with banks in secure transactions. With Parse, developers can launch mobile applications efficiently without the worry of server maintenance; plus, it is compatible with iOS, Android, JavaScript, and Windows 8. Parse's code library allows developers to add push notifications, data storage, and social into their apps. This partnership allows Stripe to be added as a payment option with the 60,000+ parse-powered applications, utilizing newly released iOS and Android code libraries that allow for easier transactions for both. In essence, developers who use this tool will find collecting payments substantially easier, which should make those apps more profitable.

Some developers have expressed grievances about using the cloud in app development, but I think the Parse/Stripe partnership is a great example of how developing in the cloud has its advantages. Given this partnership and the overall induction of the cloud into modern development for gaming and ecommerce, here are four cloud tools I have used that I think should be in any app developer's toolbox.

  • UmbrellaSDK: This basic IDE builds with HTML5 and JavaScript, allowing for cross-development between iOS and Android. The output is in real-time, and all native code is compiled server-side. This can be seen as an introductory cloud-based platform, so in your transition to cloud tools, this system would be a good place to start. It is easy to use, integrate, and learn.
  • Cloud9 IDE: This aptly named platform uses the node.js framework, which is popular for its use of C#, Perl, Scala, and other languages. It also has a collaborative function that allows developers from around the world to work together and edit/write code for whatever application is being created. Because the cloud permits such a workspace, each developer can use a personal runtime environment. This is a highly recommended IDE in which the benefits far outweigh the flaws.
  • Codenvy: This outstanding platform utilizes JavaScript, Ruby, Groovy, HTML, and many other languages. This platform is specifically geared toward Java programming, supporting both Java Server Pages and Maven.
  • CollideThis failed Google project is still useful… go figure. The source code is available to anyone who wants to use it. It runs on Java 7 JRE and uses various software tools (Guava, jkit, etc.) that provide wonderful collaborative functionality.

Friday, April 12, 2013

Difference between WCF and Web service

Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service, following table provides detailed difference between them.

Features Web Service WCF
Hosting It can be hosted in IIS It can be hosted in IIS, windows activation service, Self-hosting, Windows service
Programming [WebService] attribute has to be added to the class [ServiceContract] attribute has to be added to the class
Model [WebMethod] attribute represents the method exposed to client [OperationContract] attribute represents the method exposed to client
Operation One-way, Request- Response are the different operations supported in web service One-Way, Request-Response, Duplex are different type of operations supported in WCF
XML System.Xml.serialization name space is used for serialization System.Runtime.Serialization namespace is used for serialization
Encoding XML 1.0, MTOM(Message Transmission Optimization Mechanism), DIME, Custom XML 1.0, MTOM, Binary, Custom
Transports Can be accessed through HTTP, TCP, Custom Can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P, Custom
Protocols Security Security, Reliable messaging, Transactions
Ref.: wcftutorial.net

ITWORLD
If you have any question then you put your question as comments.

Put your suggestions as comments