adsense

Wednesday, December 22, 2010

Will MinWin and a Hyper-V client hypervisor debut in Windows 8?

If a Hyper-V client and MinWin, a stripped-down OS, appear in Windows 8, they could resolve Microsoft's argument against licensing virtualized Internet Explorer
Read more

http://searchvirtualdesktop.techtarget.com/news/2240025973/Will-MinWin-and-a-Hyper-V-client-hypervisor-debut-in-Windows-8?asrc=EM_NLT_13057333&track=NL-1108&ad=804110

cheers
Samitha

OData provides patterns for HTTP, JSON, data access

Is OData ready for prime time? Open Data Protocol, OData, is rapidly evolving. This Web protocol used for querying and updating data gives users a way to unlock data, freeing it from silos in today's applications. It defines a set of patterns for working with data based on HTTP, AtomPub, and JSON. OData originated at Microsoft, but more companies are jumping on the bandwagon. IBM, eBay, Facebook and Netflix are all OData enthusiasts, using this protocol to better serve their users.
read more http://searchwindevelopment.techtarget.com/news/2240025967/OData-Ready-for-Prime-Time?asrc=EM_USC_13057758&track=NL-150&ad=805040

Cheers
samitha

Tuesday, December 14, 2010

Sunday, November 28, 2010

An example of Test-Driven Development in SQL Server 2005

This article demonstrates principles of test-driven database development (TD3) along with Try/Catch and SqlCmd functionality. Make sure u read all 5 parts...!!!

http://www.sqlservercentral.com/articles/Testing/66553/

Cheers
samitha

Tuesday, November 9, 2010

Wednesday, November 3, 2010

MySQL Connector/NET 6.3.4 was released

New features include:
  • Ability to dynamically enable/disable query analysis at runtime
  • Visual Studio 2010 compatibility
  • Improved compatibility with Visual Studio wizards using the new SQL Server mode
  • Support for Model-First development using Entity Framework
  • Nested transaction scopes
  • Additional improvements and bug fixes
download at http://dev.mysql.com/downloads/connector/net/

Cheers
Happy coding
samitha

A Faster BETWEEN Dates

Finding records that exist between two dates can sometimes be slow. This is especially true if temporary tables and table variables are used. This article shows different ways that you can get the same records but with faster results.
http://www.sqlservercentral.com/articles/BETWEEN/71395/

Cheers
Happy coding
samitha

Using SqlMethods.Like method

The System.Data.Linq.SqlClient namespace includes a helper class called SqlMethods, which can includes a method called Like, that can be used in a Linq to SQL query:

var query = from c in ctx.Customers
            where SqlMethods.Like(c.City, "L_n%")
            select c;

This method gets the string expression to check (the customer's city in this example) and the patterns to test against which is provided in the same way you'd write a LIKE clause in SQL.

Using the above query generated the required SQL statement:

SELECT CustomerID, CompanyName, ...
FROM    dbo.Customers
WHERE  City LIKE [L_n%]

Cheers,
Happy Coding
Samitha

Thursday, October 14, 2010

10 Ways to Improve the Performance of Your WPF Application

Windows Presentation Foundation (WPF) applications are often classified as applications that are resource hungry, and yes they are. However, you can still improve their performance to a greater extent by following few techniques that we'll examine in this tutorial.
http://www.codeguru.com/csharp/.net/article.php/c18025

.NET Framework 4.0 Task Parallel Library BlockingCollection

Learn how BlockingCollection, a new .NET Framework 4.0 concurrency friendly data structure, can serve as a mediator between task classes sharing data

http://www.codeguru.com/columns/experts/article.php/c18027

cheers
samitha

Sunday, September 19, 2010

Use JavaScript To Ensure Users Agree Before Posting

Often, you may need to make sure that visitors to your site agree to specific terms before they submit a form. You may need to do so for legal reasons before they upload a file, add an image, or submit a comment. In this tutorial, we will show you how to use JavaScript to disable all the fields on a form until a user agrees to your terms.

Read more
http://links.mkt3261.com/ctt?kn=19&m=3274458&r=MTM5NTc0NzEwMTgS1&b=0&j=MTk2ODE1MDY5S0&mt=1&rt=0

cheers
samitha

Google Instant

Google Instant is a new search enhancement that shows results as you type.  key technical insight was that people type slowly, but read quickly, typically taking 300 milliseconds between keystrokes, but only 30 milliseconds (a tenth of the time!) to glance at another part of the page. This means that you can scan a results page while you type.

Read more http://www.google.com/instant/

cheers
samitha

Adding Multimedia to Google Web Toolkit (GWT) Applications

Federico Kereki demonstrates ways to add sound (and, by extension, video) to your GWT-based website using some relatively easy coding methods, with and without resorting to additional libraries. You'll also learn how to adjust your code to accommodate both HTML5-enabled and Internet Explorer browsers, depending on the user's settings, by using the advanced 'deferred binding' technique.

http://www.informit.com/click.ashx?dk=38719&u=C2BC2D11-29BF-48E7-852A-5BC13F26B96A&r=%2farticles%2farticle.aspx%3fp%3d1625682

cheers
samitha

Tuesday, September 14, 2010

Microsoft Visual Studio LightSwitch

Learn to leverage to the power of Microsoft LightSwitch with Brad Jones by creating a simple database, entry screen, and application without writing a single line of C# programming code.

http://www.codeguru.com/csharp/article.php/c17855

cheers
samitha

Saturday, September 11, 2010

ODAC for Microsoft Visual Studio 2010

Oracle has just released new versions of Oracle Developers Tools for Visual Studio, ODP.NET, Oracle Providers for ASP.NET, and .NET stored procedure support for Visual Studio 2010 and .NET Framework 4. 

With ODAC 11.2.0.1.2, developers can connect to Oracle Database versions 9.2 and higher from Visual Studio 2010 and .NET Framework 4. ODAC components support the full framework, as well as the new .NET Framework Client Profile.

download at http://www.oracle.com/technetwork/database/windows/downloads/index-101290.html?msgid=3-2161760054


Cheers
samitha

The Genetic Cloud

Cloud Computing provides almost unlimited resources. They are always available. The payment is only for usage time. Following article continues the series about new opportunities that become available to every person

cheers,
samitha

Binding Data to Silverlight 4.0 Controls Using ASP.NET MVC 2.0

Silverlight is a browser plugin that promotes a collaborative development environment of rich online media content that enables developers and designers alike to integrate multimedia and graphics into web pages within the context of the managed environment of Microsoft .NET framework. Over the past few years, Silverlight, formerly known as Windows Presentation Foundation (WPF), has quickly become the technology of choice for developing the next generation of cross-browser, cross-platform Rich Internet Applications (RIAs). ASP.NET MVC Framework is a platform that enables you to design and implement applications that are based on the MVC design pattern. This article takes a look at how ASP.NET MVC Framework 2.0 applications can be used to bind data to Silverlight 4.0 data controls.

http://www.codeguru.com/csharp/.net/article.php/c17861

Cheers
Samitha

Friday, September 10, 2010

Speed Up Repetitive Insert, Update, and Delete Query Statements

Speed up insert, update and delete queries with Table valued parameters introduced with SQL server 2008. It will save your valuable time.

Read more at http://www.codeguru.com/columns/dotnet/article.php/c17869

Cheers,
samirha


Publish Post

Rebinding Client-Side Events After a Partial Page Postback

This is a common problem we tend to face with ASP.Net update panels. Read more at
http://www.4guysfromrolla.com/articles/090810-1.aspx   for some options to make things work under such scenario.

cheers,
samitha

Thursday, September 9, 2010

Facebook adds remote logout

This seems interesting. check out the post...!

http://www.itworld.com/security/119578/to-boost-security-facebook-adds-remote-logout?source=ITWNLE_nlt_wrapup_2010-09-03


Cheers
samitha

Free Script Libraries

Whether you're creating a website for your business, or creating websites for clients, at some point you will desire to add some additional functionality to your site, and you will need a script to do so. It may be a bit of JavaScript, a PHP script, a collection of Perl scripts,  and you have no budget to purchase yet another wingding for your site, so it needs to be free. Enter the online script libraries--sites that have libraries of all sorts of scripts available for you to download and use on your site.
  • JavaScript Source - an excellent JavaScript resource with tons of "cut and paste" JavaScript examples for your Web pages
  • Script Search - listings include PHP, Perl, JavaScript, Ajax, Java, Python, ASP, XML, and Flash scripts and components, and also features an extensive array of tutorials and a searchable index
  • Hot Scripts - a PHP, CGI, Perl, JavaScript and ASP script collection and resource web portal
  • Matt's Script Archive - offering free CGI scripts to the web community since 1995
  • JavaScript Kit - a comprehensive resource for JavaScript tutorials, scripts, and more
  • Dynamic Drive - a comprehensive DHTML site featuring DHTML scripts, tutorials, and more  
Cheers
Samita

Wednesday, September 1, 2010

FormatDateTime in Microroft Reporting (RDLC)

You can use following code snippet to format date in RDLC reports.

Format(Fields!PublicationDate.Value,"dd.MM.yyyy HH:mm:ss")
You can specify the Format property (in the properties box for the date field) to the above value.

Regards
Samitha

Monday, August 2, 2010

Microsoft Report Viewer generates An error occurred during local report processing

This Works spent a lot of of my work time to figure out what the real prob was. Here are the steps to resolve this.

  1. click on it to download Microsoft Report Viewer Redistributable 2008  from http://www.microsoft.com/downloads/details.aspx?FamilyID=CC96C246-61E5-4D9E-BB5F-416D75A1B9EF&displaylang=en
  2. In command prompt Type “Cd windows\assembly\gac_msil\Microsoft.ReportViewer.pro*” and press enter
  3. To list directory contents type dir and press enter. You will see the two versions 8 and 9
  4. Type cd 9*
  5. Type copy * c:\ . Then the file will be copied in you root directory of C drive
  6. Add the Reference in to your BIN folder and put it on Server 
Cheers
Happy coding
samitha

Saturday, July 31, 2010

ASP.NET caching with Web services

In ASP.NET 2.0, the HTTP method of the test page has changed from GET to POST. However, POSTs are not ordinarily cached. Implementing proper caching in your web services can increase scalability and performance. One of the easiest ways to implement caching systems is with the CacheDuration property of the WebMethod attribute.

Eg.
[WebMethod(CacheDuration=100)]


public string GetCacheEntryTime(string Name)

{

StringBuilder sb = new StringBuilder("Hi ");

sb.Append(Name);

sb.Append(", the Cache entry was made at ");

sb.Append(System.DateTime.Now.ToString());



return(sb.ToString());

}

Wednesday, June 30, 2010

Cannot resolve collation conflict for column 2 in SELECT statement

In MS SQL SERVER, the collation can be set in column level. When compared 2 different collation column in the query, this error comes up. Following article gives you details on fixing the collation problems.

http://blog.sqlauthority.com/2007/06/11/sql-server-cannot-resolve-collation-conflict-for-equal-to-operation/

In addition select statement can also be a cause for the above problem

E.g.
SELECT  P.ID,P.PASSENGER_NAME  +' '+ISNULL(P.LAST_NAME,'')  [PASSENGER_NAME],P.BAG_COUNT 
    FROM am.PASSENGER P


In the above table both PASSENGER_NAME and LAST_NAME columns has datatype of nvarchar(50). When I ran the above query the collation conflict error occured and following way I was able to fix it.


SELECT  P.ID,
P.PASSENGER_NAME  +' '+ISNULL(P.LAST_NAME,'')  COLLATE DATABASE_DEFAULT [PASSENGER_NAME],
P.BAG_COUNT 
    FROM am.PASSENGER P


cheers
Happy coding
samitha (MCTS)

Sunday, June 20, 2010

SharePoint 2010 For Developers

English | WMV3 1024 x768 | MP3 48 Kbps | 363 MB
Genre: eLearning

Over the past several months, we’ve shared several introductory features about new assets for developers in SharePoint 2010. As Microsoft launches Office 2010 and SharePoint 2010 to businesses this week, we now bring you a real-world example of how developers can harness and capitalize upon the enhancements of the new version.

Download
http://hotfile.com/dl/47466839/714426c/SP2010FD.part1.rar.html
http://hotfile.com/dl/47466843/1607fc5/SP2010FD.part2.rar.html
http://hotfile.com/dl/47466841/e173e92/SP2010FD.part3.rar.html
http://hotfile.com/dl/47466842/28fe075/SP2010FD.part4.rar.html


cheers,
Happy coding,
Samitha

Saturday, June 12, 2010

Preventing Users From Copying Text From and Pasting It Into TextBoxes

Many websites that support user accounts require users to enter an email address as part of the registration process. This email address is then used as the primary communication channel with the user. For instance, if the user forgets her password a new one can be generated and emailed to the address on file. But what if, when registering, a user enters an incorrect email address? Perhaps the user meant to enter me@example.com, but accidentally transposed the first two letters, entering em@example.com. How can such typos be prevented?

Read more at http://www.4guysfromrolla.com/articles/060910-1.aspx

Cheers,
Samitha

New Features in Windows Communication Foundation (WCF) 4.0

Take a look at the new features and an introduction to WCF 4.0 framework.

Read More at WCF 4.0 Features

Cheers,

Samitha

Wednesday, June 9, 2010

Extract SWF files from Flash Executables

Lost your SWF file but still have a projector (EXE) version kicking around? Use exe2swf to recover your original SWF so you can get at the assets it contains instead of trying to recreate your project completely from scratch.

exe2swf

Cheers
Samitha

Sunday, June 6, 2010

Microsoft Robotics Developer Studio 2008 2.2.76.0

Microsoft® Robotics Developer Studio 2008 R3 enables hobbyists and professional or non-professional developers to create robotics applications targeting a wide range of scenarios. The R3 release is a minor update that has the functionality of the previous Standard Edition, but is available at no cost to all users. As of the R3 release there are no separate Editions and only a single download.

Download

Cheers
Samitha

Tuesday, May 18, 2010

Ajax Minifier 4.0

The Ajax Minifier is a command-line tool and a Visual Studio Build Task that enables you to minify JavaScript and Cascading Style Sheet files.


Download

Cheers,
Samitha

Monday, May 10, 2010

Calculating Date Difference in C#

The direct and simplest way to achieve this is by using the Microsoft.VisualBasic namespace and invoking the DateDiff method.

E.g.
long nYears = Microsoft.VisualBasic.DateAndTime.DateDiff(Microsoft.VisualBasic.DateInterval.Year, dt, dtNow, Microsoft.VisualBasic.FirstDayOfWeek.System, Microsoft.VisualBasic.FirstWeekOfYear.System);

There are some arguments over using this. Have look at the following link.
http://www.c-sharpcorner.com/UploadFile/DipalChoksi/DateDiff_CS_DC09132006172429PM/DateDiff_CS_DC.aspx


Other option is to write your own class. Have a look at following posting
http://www.aspcode.net/C-Datediff.aspx


Cheers,
Happy coding
samitha

Tuesday, April 27, 2010

Kaspersky 2009 trial resetter

Rather than risking using a patch etc that could be full of viruses etc, it takes 1 minute to do it manually!!!

Microsoft Net.Framework 3.5 is necessary for launch the prog

Instructions :

1.) Disable Kaspersky's 'Self-Defense' feature and finish your kaspersky product before download Kaspersky trial resetter ( because it's a false positive )
2.) If the 'Notifications' checkbox is checked the program will delete all notification messages about the Kaspersky license.
3.) If the 'Self-Defense' checkbox is checked the program will re-enable the Kaspersky's 'Self-Defense' feature.
4.) Click the 'Start Reset' button to begin.
5.) If you get a message while the resetting process is running this means that some features may need to be adjusted manually. After you finish the adjustments just click the 'Continue' button to resume the resetting process.
6.) Wait for Kaspersky to start and prompt you to activate.
7.) Activate online or with the supplied 30-Day Trial key.

It's very simple

Download trial resetter for Kaspersky 2009 (version 8.0.0.454)
http://www.megaupload.com/?d=ZDJCDVDU
 
Cheers,
samitha

.NET Framework cleanup

This .NET Framework cleanup tool is designed to automatically perform a set of steps to remove selected versions of the .NET Framework from a computer. It will remove files, directories, registry keys and values and Windows Installer product registration information for the .NET Framework.
 
Download
http://cid-27e6a35d1a492af7.skydrive.live.com/self.aspx/Blog_Tools/dotnetfx_cleanup_tool.zip

http://blogs.msdn.com/astebner/attachment/8904493.ashx


The latest version of this user's guide can be found at http://blogs.msdn.com/astebner/pages/8904493.aspx.
 
Cheers
Samitha

Thursday, April 22, 2010

Find the control inside the contenttemplate of the device specific?

In my mobile application i wanted to find a control that was in a devicespecific tag. I am surprised there was no dirac way to find that control and following work-around solved my issue.

public Control GetControl(string ID, Control cstart)
    {
        Control co = new Control();
        Type t = typeof(System.Web.UI.MobileControls.TemplateContainer);
        if (cstart.HasControls())
        {
            foreach (Control c in cstart.Controls)
            {
                if (co != null)
                {
                    if (t.IsInstanceOfType(c))
                    {
                        co = c.FindControl(ID);
                    }
                    else
                    {
                        if (c.HasControls())
                        {
                            co = GetControl(ID, c);
                        }
                    }
                }

            }
        }

        return co;
    }

If you want to find a dropdownlist named "ddlItems" inside devicespecific tag use

DropDownList ddl= (DropDownList)GetControl("ddlItems",this );

I am still searching for a simpler way to do this. In the time hope this will help in some way.

cheers
Happy coding,
samitha

ASP.NET Mobile Development with Visual Studio 2008

This link provides a way to work out Mobile application development as it is not supported by VS 2008 by default.

 http://blogs.msdn.com/webdevtools/archive/2007/01/09/tip-trick-using-mobile-web-forms-with-web-applicaiton-projects.aspx

These templates are only for the "Web Application Project" type. To do a Web Application Project you should select 'File > New Project' from the menu and then select "ASP.NET Web Application" as the project type. In that project selecting "Add New Item" hopefully should show the templates.

Cheers,
Happy Coding
Samitha

Wednesday, April 21, 2010

Enable/Disable Internal Webpage Scrollbar

To set the scrollbar for an elemnt with a web page You can try the "overflow" property in CSS/styles.

<div style="overflow:auto">...content...</div>

If you have content that is larger than the box (in this case the DIV layer) where you place the links, there will be a scrollbar to scroll to the rest of the links.

If you set overflow:hidden the the scroll bar won't be displayed for the element.

cheers,
Happy coding
Samitha

Tuesday, April 20, 2010

How to Create Aspnetdb

If you are looking for the detailed explanation for how to create asp.net membership provider database default name is aspnetdb. Look at this articles
  1.  http://programming.top54u.com/post/How-to-Create-Aspnetdb.aspx
  2. http://aspnetmembershipprovider.blogspot.com/2008/04/aspnetdbmdf.html

cheers,
Happy coding,
Samitha

Monday, April 19, 2010

error executing child request for chartimg.axd

I came across the above error when trying to get started with the ASP.net chart controls and changing the following entry in web.config solved my issue.

  <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

The simple change you have to make to get the chart to work is to add "POST" to the allowed verbs:


 <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

Cheers
Happy Coding,
Samitha 

ASP.NET MVC 2 Released

The final release of VS 2010 and Visual Web Developer 2010 will have ASP.NET MVC 2 built-in – so you won’t need an additional install in order to use ASP.NET MVC 2 with them.

You can learn more about these features in the “What’s New in ASP.NET MVC 2” document.

Wednesday, April 14, 2010

IM your friends online

Imo is a web instant messenger that helps you IM, voice chat, and video conference using multiple instant messaging protocols

https://imo.im/

Cheers,
Samitha

YouTube Update available

YouTube has turned on the new video player page for all users from March 31st. Download version 2.5.4 to fix the "no flash video found" error caused by the new video player page in the old version of YouTube Downloader.

http://download.cnet.com/YouTube-Downloader/3000-2071_4-10647340.html

Cheers
Samitha

Monday, April 5, 2010

SQL Server 2008 Top 10 features

1) Activity Monitor
2) Audit
3) Backup compression
4) Central Mgmt service
5) Data collector and Magmt warehouse
6) data Compression
7) Policy based management
8) Predictable performance and concurrency
9) Resource govener
10) Transparent Data Encryption (TDE)

Follow http://sqlcat.com/top10lists/archive/2009/01/30/top-10-sql-server-2008-features-for-the-database-administrator-dba.aspx for more details

Cheers
samitha

Saturday, April 3, 2010

Tool and techniques to identify concurrent issues.

http://msdn.microsoft.com/en-us/magazine/cc546569.aspx

This article discuses:

1) Problems in concurrency testing
2) Elusive bugs and their dependancies
3) New tools to find the road blocks
4) Best practices for designing tests

Cheers
Samitha

Wednesday, March 31, 2010

Iterate through Enum values

Here is the enum definition

public Enum Employee
{
  Manager=1,
  Lecturer=2,
  AdminOfficer=3
}

Here is the iteration of Enum
foreach ( int val in Enum.GetValues(typeof( Employee)) )
{
  strin text=Enum.GetName( typeof(Employee),val); // gets Manager,Lecturer....etc
   Console.WriteLine(text + " value" + val.ToString()); //val is the actual value in Enum 1.2....etc
}

Tuesday, March 30, 2010

Set tooltip at the controls like Checkbox list or list items ?

These controls doesn't have  a property to directly set a tool tip. In such cases following code can be useful

int i=0;

foreach (ListItem li in checkboxList.Items) {

 li.Attributes.Add("title","Tooltip " + i.ToString());
 i++;

}

Happy Coding ...!!!

Thursday, March 18, 2010

Google Adsense Terminology

Page impression: A page impression is generated every time a user views a page displaying Google ads. We will count one page impression regardless of the number of ads displayed on that page. For example, if you have a page displaying three ad units and it is viewed twice, you will generate two page impressions and six ad unit impressions.

Clicks:# The number of times an ad was clicked on in the given reporting period.

Page CTR (Clickthrough Rate): The number of ad clicks divided by the number of impressions for the page of ads that appears when a link unit is clicked.

Page eCPM (Effective Cost Per Thousand Impressions): Calculated by dividing earnings by number of page impressions and multiplying. This makes it easier to compare multiple sites to see which are performing better.

Earnings: Total revenue earned to date. More detail about earnings is available in the AdSense Help Center.

Saturday, January 30, 2010

Order By union

Unions are used to display joined results from two queries with the same list of fields.
Ex:
Select f1,f2 --f1,f2 are the fields
from tbl1 --table
where f1<1
union
Select f1,f2
from tbl1
where f1>1

If you want to order the displayed results you'd have definitely tried following way

Select f1,f2
from tbl1
where f1<1
order by f1
union
Select f1,f2
from tbl1
where f1>1
order by f1

Sadly this is not going to work. If you want to order the displayed results the above query should be modified as follows

SELECT * FROM
(
SELECT f1,f2
from tbl1
where f1<1
order by f1
union
SELECT f1,f2
from tbl1
where f1>1
order by f1
) A
ORDER BY f1,f2

Happy coding..............!

Wednesday, January 13, 2010

Numeric Text box

I have seen many people asking about using a textbox that accepts only numbers. Here I am providing some thoughts on that. I have seen many solutions diffent people have provided. But for me none of them was satisfactory. eventhough most of the textboxes allow only numbers, text valu can be pasted from right clicking mouse buttton and past option.
The solution for that is disabling paste on mouse right cliking.
'this class 'disables paste on text box

Imports System.Windows.Forms
Public Class TextBoxOnPaste
Inherits NativeWindow

Private tb As TextBox

Private Sub New()

End Sub

Public Sub New(ByVal tb As TextBox)
Me.tb = tb
Me.AssignHandle(tb.Handle)
End Sub

Private Const WM_PASTE As Integer = &H302

Protected Overrides Sub WndProc(ByRef m As Message)
'With every key press, click, key-combination press, etc a Message is sent to the
' window. You need to read about Win32 programming if you don't understand it.

Select Case m.Msg
Case WM_PASTE
'User has tried a way to paste something, like SHIFT+INSERT or
' right-click context menu...
If Clipboard.GetDataObject.GetDataPresent(DataFormats.Text) Then
'What user has tried to paste is a piece of text...
Dim str As String = Clipboard.GetDataObject.GetData(DataFormats.Text)
'Remove all appearances of coma
str = Replace(str, ",", "")
Dim NewVal As String
NewVal = Mid(tb.Text, 1, tb.SelectionStart) & str & Mid(tb.Text, tb.SelectionStart + tb.SelectionLength + 1, Len(tb.Text))
'NewVal will contain the future value of the textbox, if we would let
' what user wanted to paste to actually paste there...
If IsNumeric(NewVal) Then
' The result will be a numeric value. So go ahead and paste it!
tb.SelectedText = str
End If
' We're done, so we exit the sub (not letting the default WndProc() to
' paste the original string user tried to paste.
Exit Sub
End If
End Select
'In situations other than what we handled, the default WndProc() needs to be run MyBase.WndProc(m)
End Sub
End Class

wheew..!! Thatt's done next is overriding the onkey press event of the text box
Public Class NumericTextBox
Inherits TextBox
Public Sub New()
AddHandler MyBase.KeyPress, New KeyPressEventHandler(AddressOf Me.numericTextboxKeyPress)
Dim onPaste1 As New TextBoxOnPaste(Me)
End Sub
Private Sub numericTextboxKeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) 'Handles Me.KeyPress
Dim tb As TextBox = CType(sender, TextBox)
Dim chr As Char = e.KeyChar
If IsNumeric(e.KeyChar) And Not e.KeyChar = "-" Then
'If adding the character to the end of the current TextBox value results in
' a numeric value, go on. Otherwise, set e.Handled to True, and don't let
' the character to be added.
e.Handled = Not IsNumeric(tb.Text & e.KeyChar)
ElseIf e.KeyChar = "." Then
'For the decimal character (.) we need a different rule:
'If adding a decimal to the end of the current value of the TextBox results
' in a numeric value, it can be added. If not, this means we already have a
' decimal in the TextBox value, so we only allow the new decimal to sit in
' when it is overwriting the previous decimal.
If Not (tb.SelectedText = "." Or IsNumeric(tb.Text & e.KeyChar)) Then
e.Handled = True
End If
ElseIf e.KeyChar = "-" Then
'A negative sign is prevented if the "-" key is pressed in any location
' other than the begining of the number, or if the number already has a
' negative sign
If tb.SelectionStart <> 0 Or Microsoft.VisualBasic.Left(tb.Text, 1) = "-" Then e.Handled = True
End If
ElseIf Not Char.IsControl(e.KeyChar) Then
'IsControl is checked, because without that, keys like BackSpace couldn't
' work correctly.
e.Handled = True
End If

End Sub

End Class

You can creeate this as a library and use it in any project. If needed thousand seperators then you can customize this further.

And thats it....!!! Hope it ll be useful for you in some way...

cheers
Happy coding