Surendra Sharma

Surendra Sharma

Search This Blog

Tuesday, July 23, 2013

'SelStart' is not a member of 'System.Windows.Forms.Control'.

During migration from VB to VB.NET if you are getting error as "'SelStart' is not a member of 'System.Windows.Forms.Control'." with following type of code


'UPGRADE_WARNING: Couldn't resolve default property of object frmForm.ActiveControl.SelStart.
mytextbox.SelStart = 0
Solution: -
Use new property “SelectionStart” as below
mytextbox.SelectionStart = 0

'NewIndex' is not a member of 'System.Windows.Forms.ListBox'

During migration from VB to VB.NET if you are getting error as "'NewIndex' is not a member of 'System.Windows.Forms.ListBox'" with following type of code


mylistbox.Items.Add("MatchName")
'UPGRADE_ISSUE: ListBox property mylistbox.NewIndex was not upgraded. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="F649E068-7137-45E5-AC20-4D80A3CC70AC"'
mylistbox.SetSelected(mylistbox.NewIndex, False)

Solution: -
Store newly added item in listbox’s number in some variable and use that value in place of “NexIndex” as below
Dim currentItemNumber As Integer = mylistbox.Items.Add("MatchName")

mylistbox.SetSelected(currentItemNumber, False)

'Me' cannot be the target of an assignment.

During migration from VB to VB.NET if you are getting error as "'Me' cannot be the target of an assignment." with following type of code

'UPGRADE_NOTE: Object frmDSNs may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6E35BFF6-CD74-4B09-9689-3E1A43DF8969"'
Me = Nothing

Solution: - Just find and replace
Me = Nothing
with
'Me = Nothing

in entire project

Friday, July 19, 2013

How to get 3 character or MMM format month name in sql server

Here is query for showing complete month name, month number and month name in MMM or 3 character format

SELECT
DATENAME(mm,GETDATE()) AS [Month Name],   -- Dispaly complete Month Name
MONTH(GETDATE()) AS [Month Number], -- Dispaly Month number as NN digit
SUBSTRING(DATENAME(mm,GETDATE()),1,3) AS Month Name In MMM  -- Dispaly Month name in 3 characters
Output:


Month Name
Month Number
Month Name In MMM
July
7
Jul

Meet the richest man who became world's only 'quadrillionaire' for a minute - thanks to PayPal error

Due to some technical error in Paypal system, this man became world richest man. 

Please read more from here 
http://in.news.yahoo.com/meet-man-became-worlds-only-quadrillionaire-minute-thanks-044313668.html

Thursday, July 18, 2013

Best number of world

The world's best number is 73 as
  • 73 is 21st prime number
  • The number 21 = 7 X 3
  • Binary representation of 21 is 10101 which is palindrome
  • Its mirror is 37 which is also prime number. 37 is the 12th prime number
  • Binary representation of 73 is 1001001 which is palindrome

Human pee to charge cellphones

Scientists developed a technology from which human urine is used to charge small electric gazettes such as mobile. Beauty of this technology is that its eco-friendly and not dependent on external factors such as sun etc.

Please read complete article from here