Dim Seperator As String
Seperator = vbTab
Dim linea As String
Dim sw As StreamWriter
Dim strBuilder As New System.Text.StringBuilder
sw = File.CreateText("pathtofile.txt")
Try
Dim objCmd As New OdbcCommand(Sql, objconn)
Dim myAdapter As New OdbcDataAdapter(objCmd)
Dim ds As New DataSet()
Try
'Fill Dataset
myAdapter.Fill(ds, "mln")
Catch ex As Exception
Console.WriteLine("Error filling dataset: " & ex.tostring)
End Try
For Each Dr As DataRow In ds.Tables(0).Rows
strBuilder.Append("")
strBuilder.Append(Dr(0) & Seperator)
strBuilder.Append(Dr(1) & Seperator)
strBuilder.Append(Dr(2) & Seperator)
strBuilder.Append(Dr(3) & Seperator)
' Plus many more
strBuilder.AppendLine()
Next
linea = strBuilder.ToString
sw.WriteLine(linea)
strBuilder.Remove(0, strBuilder.Length)
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE