473,396 Members | 2,109 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,396 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 7770
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.