I got here Visual Basic 2005 Express Edition.
I am using an PostgreSQL DB v8.0!
But the Problem is, that the resulst are just -1 ?? A connection is made successfull!
Code: Select all
Imports CoreLab.PostgreSql
Imports System
Module Module1
Dim myConnection As New PgSqlConnection("host=153.19.72.155;database=conikost;user id=conikost")
Dim myCommand As PgSqlCommand = New PgSqlCommand("select * from conikost")
Public Sub PerformAsync()
myCommand.Connection = myConnection
myConnection.Open()
Dim rowsAffected As Int32
Try
Dim myResult As IAsyncResult = myCommand.BeginExecuteNonQuery(Nothing, Nothing)
Console.Write("In progress...")
While Not myResult.IsCompleted
Console.Write(".")
'Perform here any operation you need
End While
rowsAffected = myCommand.EndExecuteNonQuery(myResult)
Console.WriteLine()
Console.WriteLine("Operation complete. Rows Affected: " & rowsAffected)
Catch
Console.WriteLine("Error during execution.")
Finally
myConnection.Close()
End Try
End Sub
Sub Main()
PerformAsync()
Console.WriteLine("About to exit.")
Console.ReadLine()
End Sub