473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Connecting to PostgreSQL through SSH (putty)

111 100+
Hii all,

im doin a vb 1.1 vs.net 2003 project where im trying to update the data from mysql to postgreSQL....

when im trying to click on update , im opening the connection of PostgreSQL using SSH(secure shell)
Expand|Select|Wrap|Line Numbers
  1. Dim myPgrConnect As New NpgsqlConnection("Server=localhost; Port=8443; Database=dalitch_css; User Id=dalitch; Password=dfndev; Timeout=30")
  2.         Dim myPgrCommand As New NpgsqlCommand
  3.         Dim strSQL As String
  4.         Dim record As String
  5.         Dim intRowsAffected As Integer
  6.         Dim ds As New DataSet
  7.         Dim myTable As DataTable
  8.  
  9.         myPgrConnect.Open()..........>> Here im getting a error stating that 
  10.  
An unhandled exception of type 'System.IO.IOException' occurred in npgsql.dll
Additional information: Unable to read data from the transport connection.

plz help.....

regards
ruth
May 23 '07 #1
3 7764
michaelb
534 Expert 512MB
You said "... opening the connection of PostgreSQL using SSH(secure shell)"
This suggests that database server is installed on a remote machine.
At the same time you coded "Server=localhost;"

I am not familiar with the VB/npgsql API, but this is the first thing I would check on. While at it verify that dbname, port# and everything else in the connect string is correct.

Also make sure that your version of npgsql is compatible with your version of Postgres.
(I think the latest Frontend/Backend Protocol is now up to version 3)

There's also a chance that this is a bug in npgsql, similar cases have been reported:
http://gborg.postgresql.org/project/...pdate.php?1418
May 24 '07 #2
rhepsi
111 100+
You said "... opening the connection of PostgreSQL using SSH(secure shell)"
This suggests that database server is installed on a remote machine.
At the same time you coded "Server=localhost;"

I am not familiar with the VB/npgsql API, but this is the first thing I would check on.

Also make sure that your version of npgsql is compatible with your version of Postgres.
(I think the latest Frontend/Backend Protocol is now up to version 3)

Thnq for ur reply....

hey ure right...

Expand|Select|Wrap|Line Numbers
  1.         ' code to update the data with required fields into the post gre data base 
  2.         Dim myPgrConnect As New NpgsqlConnection
  3.         Dim myPgrCommand As New NpgsqlCommand
  4.               Dim strSQL As String
  5.         Dim record As String
  6.         Dim intRowsAffected As Integer
  7.         Dim ds As New DataSet
  8.         Dim myTable As DataTable
  9.  
  10.         Try
  11.             If Plink.HasExited = False Then
  12.                 myPgrConnect.ConnectionString = "Server=192.168.1.61; Port=5432; Database=dalitch_css; Userid=dalitch; Password=dfndev; Protocol=3; SSL=false; Pooling=true; MinPoolSize=1; MaxPoolSize=20; Encoding=UNICODE; Timeout=15; SslMode=Disable;"
  13.                 myPgrConnect.Open()
  14.             End If
  15.         Catch ex As Exception
  16.             MsgBox("Error" + ex.Message(), MsgBoxStyle.Information, "error")
  17.  
  18.             MessageBox.Show("Secure Shell is not connected", "Error Message...!!")
  19.             Return
  20.         Catch ex1 As System.NullReferenceException
  21.             MessageBox.Show("Error2: " + ex1.Message(), "Error Message...!!")
  22.             Return
  23.         End Try
  24.  
  25.         myTable = myData.Tables(0)
  26.         Dim myRow As DataRow
  27.  
  28.         'For Each myRow In mytable.Rows
  29.         '    strSQL = "UPDATE ""Tbl_Students"" SET " _
  30.         '    & " ""ST_FirstName"" = @ST_FirstName," _
  31.         '    & " ""ST_DateofBirth"" = @ST_DateofBirth, " _
  32.         '    & " ""ST_Gender"" = @ST_Gender, " _
  33.  
May 24 '07 #3
michaelb
534 Expert 512MB
I'm glad it worked for you.
Please make sure to use the correct format (especially CODE TAGS) in your next posting.
The Posting Guidelines at the top of the forum will give you more information.
May 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: LRW | last post by:
I'm sorry, I don't know if this is a mySQL issue, or a Putty error, or what. So if there's a better newsgroup for this question, please let me know. I'm using Putty to SSH into our remote Linux...
3
by: N.K. | last post by:
Hi, I've just installed postgres on the Linux server. It is supposed to start automatically which I think it does since I can run an sql stmt right away. When I'm trying to connect from a remote...
1
by: jbi130 | last post by:
I have a 3 tier client/server application where the client connection to the server which then uses PostgreSQL. I'd like to extend the client to have direct access to PostgreSQL but do not want to...
5
by: Morten Wennevik | last post by:
I made a program than can send text to Putty (A telnet/ssh client) http://www.chiark.greenend.org.uk/~sgtatham/putty/ And I discovered that Unicode characters doesn't reach it I'm using...
6
by: Alexander Cohen | last post by:
Im trying to connect locally to a database on a running postgres cluster. If i connect with psql, everything is fine and i can transact. I i try and connect in my own app, i get this error: ...
1
by: Goutam Paruchuri | last post by:
Hello, I get an error in my log when connecting to postgres server on Windows. Postgres version : 8.0.0-beta4 LOG TEXT 2004-11-10 11:22:47 LOG: invalid entry in file "C:/Program...
8
by: Ulysse | last post by:
Hello, I have a python script which runs all the time (using of library threading). I would like this scipt to run on a remote linux Os using Putty. The problem is, when I close Putty command...
0
by: A3AN | last post by:
Hi. I receive a database backup on a daily basis. I then import this dump on another server which I use for software development. There is two db's being hosted on this server. We test software...
3
by: Pvt Ryan | last post by:
Background: Due to the large number of bots attempting to ssh to my server, I implemented portknocking (as the logs were just filled with crap). So to access port 2222 for ssh I would first...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.