Archive for March 2010
31
Disable right click on particular element like textbox, text area
Comments off · Posted by vishal in ASP.Net
You may require the code to disable right click in any webpage.
Then just place the below simple code.
oncontextmenu=”return false;”
Examples:
1) Don’t want right click on whole web, place it in “body” tag.
2) Don’t want right click on particular element like textbox, text area place the code in that element
asp.net help · asp.net tutorials · disable right click for html elements · html
31
Visual Studio 2010 release date is April 12, 2010
Comments off · Posted by vishal in ASP.Net, Software Development
Visual Studio 2010’s launch will be accompanied by the release of .Net framework 4.0. The first beta of Visual Studio 2010 was released in May, 2009 in form of a Virtual PC image while the second public beta was released in October,2009. Here is a list of the new features available in Visual Studio 2010:
Microsoft has announce the new release date April 12, 2010.
And Visual Studio 2010 also brings:
- Tools for Windows 7 and SharePoint 2010
- drag-and-drop bindings with Silverlight and Windows Presentation Foundation (WPF)
- The inclusion of the Dynamic Language Runtime (DLR) for programming with scripting languages
- Parallel programming support
Vishal
http://www.conceptinfoway.net
.net framework 4.0 · .net framework 4.0 release date · visual studio 2010 · visual studio 2010 release date
31
Concept Infoway leading with web hosting services
Comments off · Posted by vishal in CPANEL
Concept Infoway acts as a one stop shop for our clients. Once our clients have developed the application they need a platform to run that application and their services. And for that the platform needs to be scalable, reliable and always ON.
Concept infoway is leading with providing web hosting services and concept infoway processes:
- 12 years of experience providing hosting services to our clients
- Serving more than 7500 sites
- 42 servers in USA, managed from india
- Hosted at word class data centre in USA with Multiple OC3 connectivity
- 24 X 7 customer care support [ 8 x 5 phone support and 24 x 7 email support]
- More than 10000 domain years registered every year
- Resellers with Enom, Opensrs, Onlinenic, D4domains to cater our clients with various TLD’s
Concept Infoway is involved in providing hosting services like:
• Reseller based hosting
• Dedicated servers
• Virtual servers
• Shared servers
• VPN access
• Email Hosting [POP3, IMAP4, Exchange server]
• Exchange servers 2007 with OWA and Mobile Sync
• Blackberry enterprise server [BES]
• Antivirus and Antispam protections
• Database Hosting
• Microsoft Share point server hosting
• Windows and Linux Hosting
• Network and server maintenance
• Consultancy for setting up servers and managing it
• DNS services
• Backup services for application and database
• FLV hosting for video streaming
For more details click here.
Vishal
http://www.conceptinfoway.net
cpanel web hosting · dedicated server hosting · reseller web hosting · server management · virtual servers hosting · vpn hosting · web hosting cheap · web server hosting
31
New Features in .NET Framework 4.0
Comments off · Posted by vishal in ASP.Net, Software Development
The Microsoft .NET Framework 4 coming up with many features for helping developers to create applications faster than ever and fully compatible with the older versions of .NET Framework. Some of the Features in the .NET Framework Version 4.0 are as follows:
Improved Security
Parallel Computing
Visual Basic and C# languages innovations
Performance and Diagnostics
Dynamic Language Run-time
In-Process Side-by-Side Execution
Interoperability
Profiling
Garbage Collection
Exceptions Handling
Corrupted State Exceptions
Covariance and Contra-variance
Base Class Libraries
Collections and Data Structures
BigInteger
SortedSet Generic Class
Tuples
I/O
File System Enumeration Improvements
Memory-Mapped Files
Isolated Storage Improvements
Compression Improvements
Reflection
Application Domain Resource Monitoring
64-bit View and Other Registry Improvements
Threading
Unified Model for Cancellation
Thread-Safe Collection Classes
Synchronization Primitives
Networking
Web
Core Services
New Features in ASP.NET AJAX 4
Web Forms
ASP.NET MVC
Dynamic Data
Visual Studio 2010 Web Designer Improvements
Web Application Deployment with Visual Studio 2010
Windows Presentation Foundation (WPF) Improvement
Windows Communication Foundation (WCF) Improvement
Managed Extensibility Framework
ADO.NET Improvement
Expression Trees
Support for WS-Discovery
Standard Endpoints
Workflow Services
Workflow Activity Model
Richer Composite Activity Options
Expanded Built-in Activity Library
Enhanced Persistence and Unloading
Improved Security
There have been two major changes to security in the .NET Framework version 4 Beta. Machine-wide security policy has been eliminated although the permissions system remains in place, and security transparency has been extended to become the default enforcement mechanism.
Visual Basic and C# languages innovations
Many innovations in the Visual Basic/C# languages like statement lambdas, implicit line continuations, dynamic dispatch, named parameters, and optional parameters.
Parallel Computing
Parallel Extensions to improve support for parallel computing which target multi-core or distributed systems. .NET Framework 4 Beta enhance support for parallel programming with a new run-time, new class library types, and diagnostic tools. These features simplify parallel development and enable developers to write efficient, fine-grained, and scalable parallel code in a natural idiom without having to work directly with threads, or the thread pool. .NET Framework 4 Beta 1 is categorized into these four areas:
Task Parallel Library Overview
Includes parallel implementations of for and foreach loops (For and For Each in Visual Basic). Enables you to define concurrent, asynchronous tasks without having to work with threads, locks, or the thread pool.
Parallel LINQ (PLINQ)
A parallel implementation of LINQ to Objects that significantly improves performance in many scenarios.
Data Structures for Parallel Programming
Includes high-performance collection classes that are lock-free and thread-safe. Also includes other lightweight objects for synchronization and lazy initialization.
Parallel Diagnostic Tools
Includes debugger windows for tasks and parallel stacks, and concurrency views in the Visual Studio Team System Profiler that you can use to debug and to tune the performance of parallel code.
Performance and Diagnostics
The Windows Software Development Kit (SDK) provides a set of performance counters that you can use to track the performance of an application. In addition to the following features, the .NET Framework 4 Beta provides improvements in startup time, working set sizes, and faster performance for multithreaded applications. A bref information on the Performance console are as follows:
Runtime Profiling
Provides an overview of the tools you can use to gather performance data about an application.
Exception Performance Counters
Describes the performance counters that provide information about the exceptions thrown by an application.
Interop Performance Counters
Describes the performance counters provide information about an application’s interaction with COM components, COM+ services, and external type libraries.
JIT Performance Counters
Describes the performance counters that provide information about code that has been just-in-time (JIT) compiled.
Loading Performance Counters
Describes the performance counters that provide information about assemblies, classes, and application domains that are loaded.
Lock and Thread Performance Counters
Describes the performance counters provide information about managed locks and threads that an application uses.
Memory Performance Counters
Describes the performance counters provide information about the garbage collector.
Networking Performance Counters
Describes the performance counters that provide information about data that an application sends and receives over the network.
Security Performance Counters
Describes the performance counters that provide information about the security checks that the common language runtime performs for an application.
Performance Counters and In-Process Side-By-Side Applications
Describes the registry setting that disambiguates multiple runtimes that may be loaded by an in-process side-by-side application.
Dynamic Language Runtime
The dynamic language runtime (DLR) is a runtime environment that adds a set of services for dynamic languages to the common language runtime (CLR). The DLR makes it easier to develop dynamic languages to run on the .NET Framework and to add dynamic features to statically typed languages. We will discuss on above feature in coming article or you can also get more information on it through links provided in bibliography.
Dynamic languages can identify the type of an object at run time, whereas in statically typed languages such as C# and Visual Basic (when you use Option Explicit On) you must specify object types at design time. Examples of dynamic languages are Lisp, Smalltalk, JavaScript, PHP, Ruby, Python, ColdFusion, Lua, Cobra, and Groovy.
In-Process Side-by-Side Execution
In-process side-by-side hosting enables an application to load and activate multiple versions of the common language runtime (CLR) in the same process.
Interoperability
New interoperability features and improvements include the following:
You no longer have to use primary interop assemblies (PIAs). Compilers embed the parts of the interop assemblies that the add-ins actually use, and type safety is ensured by the common language runtime.
You can use the System.Runtime.InteropServices..::.ICustomQueryInterface interface to create a customized, managed code implementation of the IUnknown::QueryInterface method. Applications can use the customized implementation to return a specific interface (except IUnknown) for a particular interface ID.
Profiling
In the .NET Framework 4 Beta, you can attach profilers to a running process at any point, perform the requested profiling tasks, and then detach.
Garbage Collection
The .NET Framework 4 Beta 1 provides background garbage collection; for more information, see the entry So, what’s new in the CLR 4.0 GC?(http://go.microsoft.com/fwlink/?LinkId=151482) in the CLR Garbage Collector blog.
Exceptions Handling
System.Runtime.ExceptionServices namespace, and adds the ability to handle corrupted state exceptions.
Corrupted State Exceptions
The CLR no longer delivers corrupted state exceptions that occur in the operating system to be handled by managed code, unless you apply the HandleProcessCorruptedStateExceptionsAttribute attribute to the method that handles the corrupted state exception.
Alternatively, you can add the following setting to an application’s configuration file:
legacyCorruptedStateExceptionsPolicy=true
Covariance and Contravariance
Several generic interfaces and delegates now support covariance and contravariance. For more information, see Covariance and Contravariance in the Common Language Runtime.
Base Class Libraries
The following sections describe new features in collections and data structures, exception handling, I/O, reflection, threading, and Windows registry.
Collections and Data Structures
Enhancements in this area include the new System.Numerics … BigInteger structure, the System.Collections.Generic… SortedSet < (Of <(T>) >) generic class, and tuples.
BigInteger
The new System.Numerics… BigInteger structure is an arbitrary-precision integer data type that supports all the standard integer operations, including bit manipulation. It can be used from any .NET Framework language. In addition, some of the new .NET Framework languages (such as F# and IronPython) have built-in support for this structure.
SortedSet Generic Class
The new System.Collections.Generic… SortedSet < (Of <(T>)> ) class provides a self-balancing tree that maintains data in sorted order after insertions, deletions, and searches. This class implements the new System.Collections.Generic… ISet <(Of <(T>)>) interface.
The System.Collections.Generic… HashSet <(Of <(T>)>) class also implements the ISet <(Of <(T>)>) interface.
Tuples
A tuple is a simple generic data structure that holds an ordered set of items of heterogeneous types. Tuples are supported natively in languages such as F# and IronPython, but are also easy to use from any .NET Framework language such as C# and Visual Basic. The ..NET Framework 4 Beta 1 adds eight new generic tuple classes, and also a Tuple class that contains static factory methods for creating tuples.
I/O
The key new features in I/O are efficient file enumerations, memory-mapped files, and improvements in isolated storage and compression.
File System Enumeration Improvements
New enumeration methods in the Directory and DirectoryInfo classes return IEnumerable<(Of <(T>)>) collections instead of arrays. These methods are more efficient than the array-based methods, because they do not have to allocate a (potentially large) array and you can access the first results immediately instead of waiting for the complete enumeration to occur.
There are also new methods in the static File class that read and write lines from files by using IEnumerable<(Of <(T>)>) collections. These methods are useful in LINQ scenarios where you may want to quickly and efficiently query the contents of a text file and write out the results to a log file without allocating any arrays.
Memory-Mapped Files
The new System.IO.MemoryMappedFiles namespace provides memory mapping functionality, which is available in Windows. You can use memory-mapped files to edit very large files and to create shared memory for inter-process communication. The new System.IO… UnmanagedMemoryAccessor class enables random access to unmanaged memory, similar to how System.IO… UnmanagedMemoryStream enables sequential access to unmanaged memory.
Isolated Storage Improvements
Partial-trust applications, such as Windows Presentation Framework (WPF) browser applications (XBAPs) and ClickOnce partial-trust applications, now have the same capabilities in the .NET Framework as they do in Silverlight. The default quota size is doubled, and applications can prompt the user to approve or reject a request to increase the quota. The System.IO.IsolatedStorage..::.IsolatedStorageFile class contains new members to manage the quota and to make working with files and directories easier.
Compression Improvements
The compression algorithms for the System.IO.Compression… DeflateStream and System.IO.Compression… GZipStream classes have improved so that data that is already compressed is no longer inflated. This results in much better compression ratios. Also, the 4-gigabyte size restriction for compressing streams has been removed.
Reflection
The .NET Framework 4 Beta 1 provides the capability to monitor the performance of your application domains.
Application Domain Resource Monitoring
Until now, there has been no way to determine whether a particular application domain is affecting other application domains, because the operating system APIs and tools, such as the Windows Task Manager, were precise only to the process level. Starting with the .NET Framework 4 Beta 1, you can get processor usage and memory usage estimates per application domain.
Application domain resource monitoring is available through the managed AppDomain class, native hosting APIs, and event tracing for Windows (ETW). When this feature has been enabled, it collects statistics on all application domains in the process for the life of the process.
64-bit View and Other Registry Improvements
Windows registry improvements include the following:
Ability to specify a 32-bit or 64-bit view of the registry with the Microsoft.Win32… RegistryView enumeration when you open base keys.
the new Microsoft.Win32… RegistryOptions enumeration, which lets you specify a volatile registry key that does not persist after the computer restarts.
Threading
General threading improvements include the following:
The new Monitor… Enter(Object, Boolean%) method overload takes a Boolean reference and atomically sets it to true only if the monitor is successfully entered.
You can use the Thread… Yield method to have the calling thread yield execution to another thread that is ready to run on the current processor.
The following sections describe new threading features.
Unified Model for Cancellation
The .NET Framework 4 Beta 1 provides a new unified model for cancellation of asynchronous operations. The new System.Threading… CancellationTokenSource class is used to create a CancellationToken that may be passed to any number of operations on multiple threads. By calling Cancel()()() on the token source object, the IsCancellationRequested property on the token is set to true and the token’s wait handle is signaled, at which time any registered actions with the token are invoked. Any object that has a reference to that token can monitor the value of that property and respond as appropriate.
Thread-Safe Collection Classes
The new System.Collections.Concurrent namespace introduces several new thread-safe collection classes that provide lock-free access to items whenever useful, and fine-grained locking when locks are appropriate. The use of these classes in multi-threaded scenarios should improve performance over collection types such as ArrayList, and List< (Of <(T>) >).
Synchronization Primitives
New synchronization primitives in the System.Threading namespace enable fine-grained concurrency and faster performance by avoiding expensive locking mechanisms. The Barrier class enables multiple threads to work on an algorithm cooperatively by providing a point at which each task can signal its arrival and then block until the other participants in the barrier have arrived. The CountdownEvent class simplifies fork and join scenarios by providing an easy rendezvous mechanism. The ManualResetEventSlim class is a lock-free synchronization primitive similar to the ManualResetEvent class. ManualResetEventSlim is lighter weight but can only be used for intra-process communication. The SemaphoreSlim class is a lightweight synchronization primitive that limits the number of threads that can access a resource or a pool of resources at the same time; it can be used only for intra-process communication. The SpinLock class is a mutual exclusion lock primitive that causes the thread that is trying to acquire the lock to wait in a loop, or spin, until the lock becomes available. The SpinWait class is a small, lightweight type that will spin for a time and eventually put the thread into a wait state if the spin count is exceeded.
Networking
Enhancements have been made that affect how integrated Windows authentication is handled by the HttpWebRequest, HttpListener, SmtpClient, SslStream, NegotiateStream, and related classes in the System.Net and related namespaces. Support was added for extended protection to enhance security. The changes to support extended protection are available only for applications on Windows 7. The extended protection features are not available on earlier versions of Windows. For more information, seeIntegrated Windows Authentication with Extended Protection.
Web
Core Services
ASP.NET 4 introduces a number of features that improve core ASP.NET services such as output caching and session-state storage.
Web.config File Minification
Extensible Output Caching
Auto-Start Web Applications
Permanently Redirecting a Page
The Incredible Shrinking Session State
Expanding the Range of Allowable URLs
Extensible Request Validation
Object Caching and Object Caching Extensibility
Extensible HTML, URL, and HTTP Header Encoding
Performance Monitoring for Individual Applications in a Single Worker Process
Multi-Targeting
New Features in ASP.NET AJAX 4
The new functionality in ASP.NET AJAX enables new client data scenarios for page and component developers that enable JSON data from the server to be rendered as HTML in a highly manageable and efficient way. To enable these scenarios, ASP.NET AJAX includes the following major features:
Client-side template rendering.
Declarative instantiation of client-side behaviors and controls.
Live data binding.
Use of the observer pattern with JavaScript types.
An AdoNetServiceProxy class for client-side interaction with ADO.NET Data Services.
A client-side DataView control for data-bound UI in the browser.
DataContext and AdoNetDataContext classes for interaction with Web services.
Refactored ASP.NET AJAX framework libraries.
Support for the DOM Ready event.
Using JSONP to retrieve cross-domain data.
Web Forms
Web Forms has been a core feature in ASP.NET since the release of ASP.NET 1.0. Many enhancements have been in this area for ASP.NET 4, including the following:
The ability to set meta tags.
More control over view state.
Easier ways to work with browser capabilities.
Support for using ASP.NET routing with Web Forms.
More control over generated IDs.
The ability to persist selected rows in data controls.
More control over rendered HTML in the FormView and ListView controls.
Filtering support for data source controls.
ASP.NET MVC
ASP.NET MVC was introduced as an add-on framework to ASP.NET 3.5 SP1 in March 2009. Visual Studio 2010 will include a preview of ASP.NET MVC 2. When Visual Studio 2010 ships, it will include the RTM version of ASP.NET MVC 2. The version of ASP.NET MVC 2 that is included in ASP.NET 4 Beta 2 includes new features and capabilities.
Dynamic Data
Dynamic Data was introduced in the .NET Framework 3.5 SP1 release in mid-2008. This feature provides many enhancements for creating data-driven applications, including the following:
Enabling Dynamic Data for Existing Projects
Declarative DynamicDataManager Control Syntax
Entity Templates
New Field Templates for URLs and E-mail Addresses
Creating Links with the DynamicHyperLink Control
Support for Inheritance in the Data Model
Support for Many-to-Many Relationships (Entity Framework Only)
New Attributes to Control Display and Support Enumerations
Enhanced Support for Filters
Visual Studio 2010 Web Designer Improvements
The Web page designer in Visual Studio 2010 has been enhanced for greater CSS compatibility, includes additional support for HTML and ASP.NET markup snippets, and features a redesigned version of IntelliSense for JScript.
Improved CSS Compatibility
HTML and JScript Snippets
JScript IntelliSense Enhancements.
Web Application Deployment with Visual Studio 2010
Today, deploying a Web application is not as easy as it should be. ASP.NET developers often find that they encounter issues such as the following:
Web Packaging
Web.config Transformation
Database Deployment
One-Click Publish for Web Applications
Resources
Windows Presentation Foundation (WPF) Improvement
Improvements in WPF with new Line of Business controls. Improved Ability to Extend WF Designer Experience. Windows Presentation Foundation (WPF) contains changes and improvements in many areas includes controls, graphics, and XAML.
Windows Communication Foundation (WCF) Improvement
New enhancements to Windows Communication Foundation (WCF) such as support for WCF Workflow Services enabling workflow programs with messaging activities, correlation support, durable two-way communication and rich hosting capabilities. .NET Framework 4 also provides new WCF features such as service discovery, router service, simplified configuration and a number of improvements to queuing, REST support, diagnostics, and performance.
Managed Extensibility Framework
The Managed Extensibility Framework (MEF) is a new library in the .NET Framework 4 Beta 1 that enables you to build extensible and composable applications. MEF enables application developers to specify points where an application can be extended, expose services to offer to other extensible applications, and create parts for consumption by extensible applications. It also enables easy discoverability of available parts based on metadata, without the need to load the assemblies for the parts.
ADO.NET Improvement
The ADO.NET Entity Framework, which simplifies how developers program against relational databases by raising the level of abstraction.
Expression Trees
Expression trees are extended with new types that represent control flow, for example, LoopExpression and TryExpression. These new types are used by the dynamic language runtime (DLR) and not used by LINQ.
Support for WS-Discovery
The Service Discovery feature enables client applications to dynamically discover service addresses at run time in an interoperable way using WS-Discovery. The WS-Discovery specification outlines the message-exchange patterns (MEPs) required for performing lightweight discovery of services, both by multicast (ad hoc) and unicast (using a network resource).
Standard Endpoints
Standard endpoints are pre-defined endpoints that have one or more of their properties (address, binding, contract) fixed. For example, all metadata exchange endpoints specify IMetadataExchange as their contract, so there is no need for a developer to have to specify the contract. Therefore, the standard MEX endpoint has a fixed IMetadataExchange contract.
Workflow Services
With the introduction of a set of messaging activities, it is easier than ever to implement workflows that send and receive data. These messaging activities enable you to model complex message exchange patterns that go outside the traditional send/receive or RPC-style method invocation.
Workflow
Windows Workflow Foundation (WF) in .NET Framework 4 Beta 1 changes several development paradigms from earlier versions. Workflows are now easier to create, execute, and maintain.
Workflow Activity Model
The activity is now the base unit of creating a workflow, instead of using the SequentialWorkflowActivity or StateMachineWorkflowActivity classes. The WorkflowElement class provides the base abstraction of workflow behavior. Activity authors implement WorkflowElement objects imperatively when they have to use the breadth of the runtime. The Activity class is a data-driven WorkflowElement object where activity authors express new behaviors declaratively in terms of other activity objects.
Richer Composite Activity Options
The Flowchart class is a powerful new control flow activity that enables authors to construct process flows more naturally. Procedural workflows benefit from new flow-control activities that model traditional flow-control structures, such as TryCatch and Switch.
Vishal
http://www.conceptinfoway.net
.net framework 4.0 new features · ado.net features · asp.net application development india · asp.net mvc · netwokring · new feature in asp.net ajax 4 · threading · visual studio 2010 new features · wcf · workflow services · wpf
Problem:
How to resolve the problem of “Cannot start Microsoft Office Outlook. Cannot Open the Outlook Window” for Microsoft Outlook 2007
Many a times we face some strange problems with our office applications. The above one is one such of them.
Solution:
This problem has a very simple solution with a 3 step process:
Step 1: Open the Command prompt
Step 2: Type in outlook.exe /resetnavpane
Step 3: Execute by clicking on the Enter key
Basically, this is the same as deleting your profilename.xml in your user directory.
This did the trick for me.
Hope it helps.
30
How to avoid duplicate entry of a record in database when user hits refresh.
Comments off · Posted by kushan in ASP.Net
Problem:
In case we are saving data in database on click of a button, and what happens if a user hits refresh??
The data will be saved twice in the database. How can we avoid this behavior??
Solution:
Here is the solution in case the website is being developed in asp.net version 1.1 + with C# as the scripting language. The below implementation is designed by keeping “Order of page lifecycle events” in mind. The event order is Page_Load => btnSubmit_Click => Page_PreRender. The following code can be implemented to avoid the problem.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Session["RefrechCheck"] = DateTime.Now.ToString();
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
ViewState["RefrechCheck"] = Session["RefrechCheck"];
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Page.IsValid && Session["RefrechCheck"].ToString() == ViewState["RefrechCheck"].ToString())
{
Session["RefrechCheck"] = DateTime.Now.ToString();
int result = SaveComment();
}
}
Happy coding.
Windows Virtual PC is a virtualization program for Microsoft Windows operating systems, and an emulation program for Mac OS X on PowerPC-based systems. The newest release, Windows Virtual PC, is available only for Windows 7 hosts.
Why use virtual PC?
- It gives the ability to use different operating system on same machine at same time.
- Virtual PC can access all the hardware of the host operating system.
System requirements [System requirements for Windows Virtual PC]
- 1+ GHz processor (32- or 64-bit)
- 1.25 GB memory required (2 GB recommended)
- Additional 15 GB of hard disk space per virtual Windows environment recommended
- A processor with Hardware Assisted Virtualization Technology, to make better performance.
Step 1:
Click here to download Virtual PC and install on host operating system.
Step 2:
Create a new virtual machine
Step 3:
Select Name and location of virtual PC
Step 4:
Select Operating system
Step 5:
Assign Memory of the guest operating system
1. Using the recommended RAM
2. Adjusting RAM
Step 6:
Select Virtual Hard drive
1. Existing hard drive
2. New Virtual hard disk
Step 7:
Completing new Virtual machine wizard
Step 8:
Select Virtual PC network settings
If cannot connect to the network card, please folow below steps
Step 9:
Start Virtual PC and enjoy Virtualization with Microsoft Virtual PC.
Problem:
How to match whole word in SQL.
We very frequently face the requirement to match an entire word, while developing the website/application.
Solution:
This problem can be very easily handled by Microsoft SQL query.
For example when you search for “ram”, if you use “%ram%” it will also match “programme”.
To resolve this, we can use regular expression like syntax in SQL.
The below query will only return the title having “ram” and not “programme”.
select title from article where ‘ ‘+title like ‘%[ ]ram[ ]%’
Additionally we also can provide extra characters to match after word like
select title from article where ‘ ‘+title like ‘%[ -_]ram[ .-_]%’
Enjoy working with SQL.
27
How to modify your MX records for Google Apps Mail / Gmail?
Comments off · Posted by Administrator in CPANEL
Problem:
Gmail provides free mail services, mostly people think it as Gmail.com services which you need to check from webmail i.e. www.gmail.com , but to break that jinx , Google also provides POP3 / IMAP solutions, so you can also configure Gmail on your outlook or any other mail client.
apart from that you can also point your domain i.e. yourcompanydomain.com to gmail to provide POP3 / IMAP / webmail for your own domain name, so you no more need to use free email from @gmail.com , instead you can use yourname@yourcompanyname.com , and best part of gmail APP services is , it’s free. but yes, only upto 25 users. if you want to go above 25 users, Google charges for the same.
so what you need to do in order to user Google APPS for your mailing solution.?
Solution
First thing you need to do is sign-up for the google Apps.
Once you sign up your domain for Google Apps, you will have to change the MX records for your domain in order to use it in Gmail.
If you are using cPanel, this can be easily done by using the MX Entry option. There find the domain you will be pointing to Google Apps Mail and delete all of its MX records.
Then add the following MX records with the corresponding priority for your domain:
Priority: 1 to: ASPMX.L.GOOGLE.COM
Priority: 2 to: ALT1.ASPMX.L.GOOGLE.COM
Priority: 3 to: ALT2.ASPMX.L.GOOGLE.COM
Priority: 4 to: ASPMX2.GOOGLEMAIL.COM
Priority: 5 to: ASPMX3.GOOGLEMAIL.COM
Priority: 6 to: ASPMX4.GOOGLEMAIL.COM
Priority: 7 to: ASPMX5.GOOGLEMAIL.COM
The above instructions are in full compliance with the official Google Apps instructions and have been adapted to work with cPanel. They will require 24 hours to propagate and take effect. After that your mail will be handled exclusively by Google Apps Mail.
If your host does not use cPanel, you will have to find another way to change the MX records to Gmail. Still, the changes will be very similar to the above and the DNS records will be the same.
Still if you wish to do any changes and think you need our help please contact our support Team.
Happy Emailing.
Rikin Shah
Problem:
We face the problem of how to find out the first day and last day of a week or a month, while developing a website/application.
Solution:
This can simply be calculated with the help of SQL queries. We can have a query executed, which ultimately calls a SQL function to do the needful. Please find below the query and the function for the same.
Query:
This query calculates the first and the last day of a week, by keeping the current date as the point of reference. The current date can be retrieved directly from SQL, by using its default function getdate().
declare @Sundayofweek datetime,@saturdayofweek datetime
declare @Lastdayoflastmonth datetime,@Firstdayofnextmonth datetime
set @Sundayofweek=(SELECT Sunday FROM dbo.DisplayCurrentWeekDateDays(dbo.Getdate()))
set @saturdayofweek=(SELECT saturday FROM dbo.DisplayCurrentWeekDateDays(dbo.Getdate()))
set @Lastdayoflastmonth=(DATEADD(dd,-(DAY(dbo.Getdate())),dbo.Getdate()))
set @Firstdayofnextmonth=(DATEADD(dd,-(DAY(DATEADD(mm,1,dbo.Getdate()))-1),DATEADD(mm,1,dbo.Getdate())))
The above query can return the following results:
- Sunday as the first day of the current week
- Saturday as the last day of the current week
- The first day of the current month
- The last day of the current month
Function:
This function returns the required day of the week, based on the current date passed as a parameter from the above query.
ALTER FUNCTION [dbo].[DisplayCurrentWeekDateDays]
(@today SMALLDATETIME)
RETURNS @WeekDateDay TABLE
(
Sunday SMALLDATETIME,
Monday SMALLDATETIME,
Tuesday SMALLDATETIME,
Wednesday SMALLDATETIME,
Thursday SMALLDATETIME,
Friday SMALLDATETIME,
Saturday SMALLDATETIME
)
AS
BEGIN
DECLARE @day INT
SET @today = CAST(CONVERT(VARCHAR(10), @today, 101) AS SMALLDATETIME)
SET @day = DATEPART(dw, @today)
INSERT INTO @WeekDateDay (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday)
SELECT DATEADD(dd, 1 – @day, @today) Sunday,
DATEADD(dd, 2 – @day, @today) Monday,
DATEADD(dd, 3 – @day, @today) Tuesday,
DATEADD(dd, 4 – @day, @today) Wednesday,
DATEADD(dd, 5 – @day, @today) Thursday,
DATEADD(dd, 6 – @day, @today) Friday,
DATEADD(dd, 7 – @day, @today) Saturday
RETURN
END
This worked for me.
