Surendra Sharma

Surendra Sharma

Search This Blog

Tuesday, July 23, 2013

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

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


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

Solution: -
Store number of newly added item of CheckedListBox in some variable and use that value in place of “NexIndex” as below

Dim currentItemNumber As Integer = myCheckedListBox.Items.Add("MatchName")

myCheckedListBox.SetSelected(currentItemNumber, False)

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

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


'UPGRADE_WARNING: Couldn't resolve default property of object mytextbox.SelLength.
mytextbox.SelLength = 0
Solution: -
Use new property “SelectionLength” as below

mytextbox.SelectionLength = 0

'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