Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.NET Equivalents

Status
Not open for further replies.

AdamDW

Programmer
Aug 25, 2011
3
US
I am trying to re-write an Access database in VB.NET. One of the requirements in that it is supposed to be re-written in (to use the phrase they used) "true VB.NET". This means that I cannot use any of the commands found in the Microsoft.VisualBasic reference.

I need to know what the equivalent commands in VB.NET are of the following:
* DatePart
* DateInterval
* Today
* Now
* Format
* IsDBNull
* FileOpen
* OpenMode
* EOF
* LineInput
* LTrim
* vbNewLine
* vbCrLf
* FileClose
* IsNumeric
* Space
* Len
* Trim
* FormatDateTime
* DateFormat

I have attempted to convince the powers that be that using the Microsoft.VisualBasic reference is 100% true .NET code (based on another web page that I was researching) but that argument has fallen on deaf ears.

Please advise.

Thank you.
 
This is pretty strange on the part of the company. When you code in VB.NET you are using the Microsoft.VisualBasic namespace by default. If you can't use anything in there, you can't code in VB.NET. What do they want you to use? Microsoft.Csharp?

Maybe they don't want you to use anything that is backward compatible with VB6?
 
Most should be pretty easy to figure out, think classes instead of commands.

VB
Dim d As DateTime = Now()
DatePart(DateInterval.Day, d)

VB.net
Dim d As DateTime = DateTime.Now
d.Day



Dim s as string = " Leading Spaces"

VB
s = LTrim(s)

VB.net
s = s.TrimStart

Hope this helps, if there are some you can't figure out let me know and I'll see if I can figure it out.
 
Maybe they are concerned how much longer the VB 6.0 run time binaries will be supported...

Use the conversion wizard to get an idea how things will be converted. Things using the VB 6.0 will get flagged with a prefix to VB 6.0

I wouldn't use it to actually convert the project though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top