Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27193

sdf database to textfile

$
0
0
Imports System.Data.OleDb
Imports System.Data.SqlServerCe
Imports System.IO
Public Class Form1
Dim ds As New DataSet()
Private Sub btnfill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfill.Click
Dim conn As New SqlCeConnection()
conn.ConnectionString = ("Data Source = D:\SDF Databases\operations.sdf")
Dim strSQL As String = "SELECT IDNum, Name, Age FROM OpTab"
Dim da As New SqlCeDataAdapter(strSQL, conn)
da.Fill(ds)
End Sub

Private Sub btnchange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnchange.Click
Dim filePath As String = "D:\SDF Databases\write_here.txt"
Using writer As New StreamWriter(filePath)
For Each row As DataRow In table.Rows <- here
writer.WriteLine(String.Join(",", row.ItemArray))
Next
End Using
End Sub
End Class


i have two buttons named:
fill table and sdf to notepad
but there's an indication that table is not declared.
For Each row As DataRow In table.Rows

Viewing all articles
Browse latest Browse all 27193


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>