[RESOLVED] [2005] Converting my vb.net 2003 to vb.net 2005
elow everyone i have here my code and i want to convert it to vb.net 2005. How can I do it? really need help.
Code:
If File.Exists Then
dsStore.ReadXml(xmlFile)
With cmbStore
.DataSource = dsStore.Tables("Store")
.ValueMember = "name"
End With
Else
The "File" there will appear as an error saying Name is not declared but on my vb.net syntax it will not appear as an error. How can I do it guys? Thanks in advance and God Bless..:wave:
Re: [2005] Converting my vb.net 2003 to vb.net 2005
It's not a conversion issue. That's not valid VB.NET 2003 either. In either version the File.Exists method requires a parameter containing a file path that you want to check for the existence of:
vb.net Code:
If File.Exists(someFilePath) Then
That said, The File class is a member of the System.IO namespace. Again, regardless of your version you must either import that namespace or qualify the class name.
Re: [2005] Converting my vb.net 2003 to vb.net 2005
The only way that you weren't getting an error is if somewhere else in your code a variable "File" was declared, along with a filepath.
Re: [2005] Converting my vb.net 2003 to vb.net 2005
ahhh ic...thanks for you both jmcilhinney and MaximilianMayrhofer..God Bless...