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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert array element to Upper Case 1

Status
Not open for further replies.

egodette

Technical User
Jun 12, 2002
222
0
0
US
How can I convert one element in this array to uppercase as it is being written to a file? I want dr(1) in Upper Case. I tried
vbUpperCase(dr(1)) but it gives me an error.

Code:
Dim sw As New System.IO.StreamWriter("F:\myfiles\" & Format(Now, "MMddyy") & ".tmp")
  'Loop through each DataRow in the DataTable within the DataSet
  For Each dr As DataRow In myDataSet.Tables(0).Rows
    sw.WriteLine(dr(0) & "," & dr(1))
  Next
 
Oops, hit submit too soon.
UCase(dr(1)) would be the "classic VB" equivalent; you could also use dr(1).ToUpper if dr(1) is a string, or dr(1).ToString.ToUpper if you need to convert it to a string first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top