The following code worked fine with VB.NET 2003 and however when i made use of the same piece of code in VB.NET 2005, the End Function is underline but the whole code could be executed without any error. May i know how to get rid of the underline for good programming practise? Thank you.
VB.NET:
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Function[/COLOR][/SIZE][SIZE=2] Data_Retrieval([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] emp_no_t [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]OleDbCommand1.CommandText = [/SIZE][SIZE=2][COLOR=#800000]"SELECT * FROM Emp_Profile"[/COLOR][/SIZE]
[SIZE=2]OleDbCommand1.Connection = OleDbConnection1[/SIZE]
[SIZE=2]OleDbConnection1.Open()[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] DReader [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] OleDb.OleDbDataReader = OleDbCommand1.ExecuteReader[/SIZE]
[SIZE=2][COLOR=#0000ff]Do[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]While[/COLOR][/SIZE][SIZE=2] DReader.Read[/SIZE][INDENT][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] emp_no_t = DReader([/SIZE][SIZE=2][COLOR=#800000]"emp_no"[/COLOR][/SIZE][SIZE=2]).ToString [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][/INDENT][INDENT][SIZE=2][INDENT]emp_name.Text = DReader([/INDENT][/SIZE][INDENT][SIZE=2][COLOR=#800000]"emp_name"[/COLOR][/SIZE][SIZE=2]).ToString[/SIZE][/INDENT][INDENT][SIZE=2][COLOR=#0000ff]Exit[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Do[/COLOR][/SIZE][/INDENT][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/INDENT][SIZE=2][COLOR=#0000ff]Loop[/COLOR][/SIZE]
[SIZE=2]OleDbConnection1.Close()[/SIZE]
[U][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/U][SIZE=2][COLOR=#0000ff][U]Function[/U][/COLOR][/SIZE]
Last edited: