Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I am trying to create an application using a Pervasive database, but I cannot get the Pervasive SQL Data adapter or Connection components to work. Anyone used these yet? I can make the application run somewhat using an OLE DB connection, but would rather use managed code. Any help would be much appreciated!
I'd rather be riding than working
Posted

I have found that, in general, it is the same as working with System.Data.SqlClient.

 

Where's the problem. What are you using for a connect string, as this hung me up for a bit.

Posted
I've gotten the application to connect to the database now, but I am having a hard time getting it to update and insert records. As lame as it sounds, I am used to the wizards that microsoft created for their data providers. Creating update and insert commands from scratch is not something I have had to do before. :(
I'd rather be riding than working
Posted

This should help. Notice the question marks in the SQL statment instead of something like #LockerID. It's odd, but PSQL likes it that way.

 

daHMLRENTS = New PsqlDataAdapter("SELECT * FROM HMLRENTS", cn)

Dim SQLInsert As String
SQLInsert = "INSERT INTO HMLRENTS (LockerID, IDCUST, StartDate, StopDate, Keys, Notes) VALUES " & _
                   "(?, ?, ?, ?, ?, ?);"

Dim InsertCMD As New PsqlCommand(SQLInsert, cn)
With InsertCMD.Parameters
   .Add("LockerID", PsqlDbType.Integer, 4, "LockerID")
   .Add("IDCUST", PsqlDbType.VarChar, 12, "IDCUST")
   .Add("StartDate", PsqlDbType.Date, 4, "StartDate")
   .Add("StopDate", PsqlDbType.Date, 4, "StopDate")
   .Add("Keys", PsqlDbType.VarChar, 20, "Keys")
   .Add("Notes", PsqlDbType.VarChar, 254, "Notes")
End With

daHMLRENTS.InsertCommand = InsertCMD

daHMLRENTS.Fill(dsHMLRENTS, "HMLRENTS")

Posted
I assume the update command would be very similar? How did you setup you dataset? Like I said, this is new to me. For some reason my company decided to go with Pervasive on our latest project.
I'd rather be riding than working
Posted
I assume the update command would be very similar?

 

Yes, update follows the same format.

 

INSERT INTO tablename SET col1 = ?, col2 = ?, col3 = ?

 

 

How did you setup you dataset? Like I said' date=' this is new to me. For some reason my company decided to go with Pervasive on our latest project.[/quote']

 

Like as in what program I used? "Control Center", unless you're using linux, then "dbmaint" to create the DB and "Control Center" to add tables.

 

Frankly, I'd like to see an expert PSQL developer at work so I could find at least one justification for using this stupid software. I think that Accpac is the only reason and I think it's just that they've been using it forever.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...