請教大家
下列語法執行後將會在 server端的路徑下產生csv 檔案, 如何改成由client端來產生檔案呢?
謝謝
Dim conString As String = ".....connect connection...."
Dim ourDataTable As DataTable = Nothing
Dim connection As Npgsql.NpgsqlConnection = New Npgsql.NpgsqlConnection(conString)
connection.Open()
'Dim cmd2 As New NpgsqlCommand("SELECT spaceid,spacename from spaces \g /tmp/orders.txt", connection)
Dim cmd2 As New NpgsqlCommand("COPY (SELECT spaceid,spacename from spaces) TO '/tmp/lues_tracks.csv' DELIMITER ',' CSV HEADER", connection)
cmd2.Parameters.Clear()
Try
cmd2.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try