Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net Connection String Pervasive.Data.SqlClient

Hi
I used the following code to pull data from a Pervasive database on my local machine.
I now want to load my app onto a Pastel users machine so they can view their Pastel
I assume that I just need the name of their Pastel Pervasive database.
Do I just replace the name in theconnection string or do I need to do more?

Imports System.Windows.Forms
Imports System.Data
Imports System.Data.Common
Imports Pervasive.Data.SqlClient

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim strConn As String = "server=LocalHost;database=Demodata"
        Dim objConn As New PsqlConnection(strConn)
        Dim objDS As New DataSet
        Dim daPeople As New PsqlDataAdapter("SELECT * FROM Person", objConn)

        ListView1.Clear()
        daPeople.Fill(objDS, "dtPeople")

        ListView1.View = System.Windows.Forms.View.Details
        ListView1.Columns.Add("ID", 85, HorizontalAlignment.Left)
        ListView1.Columns.Add("Last_Name", 65, HorizontalAlignment.Left)
        ListView1.Columns.Add("First_Name", 365, HorizontalAlignment.Left)

        For Each dr In objDS.Tables("dtPeople").Rows
            Dim str(3) As String
            Dim itm As ListViewItem
            str(0) = dr("ID").ToString
            str(1) = dr("Last_Name").ToString
            str(2) = RTrim(dr("First_Name").ToString)
            itm = New ListViewItem(str)
            ListView1.Items.Add(itm)
        Next

    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks