Problem with connection to AS400

U

Uri Dimant

Hello,friends
I've got this error now after user tries to connect to AS400 ("Ordinal=1
Status=UnsupportedConversion)
Can someone shed light on the problem?
Public Const CONNECTION_STRING As String = "Provider=IBMDA400;Data
Source=00000.1;User ID=KK;Password=RR"

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load

Dim sql As String

Dim strCon As String

Dim ds As DataSet = New DataSet("test")

strCon = CONNECTION_STRING

Dim cn1 As OleDb.OleDbConnection = New OleDb.OleDbConnection(strCon)

cn1.Open()

Dim adp1 As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter

Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("select COL from
TABLE where COL= 8881221", cn1)

cmd.CommandType = CommandType.Text

adp1.SelectCommand = cmd

adp1.TableMappings.Add("Table", "Partner")

Try

adp1.Fill(ds)

Catch ex As Exception

MsgBox(ex.Message)

End Try

DataGrid1.SetDataBinding(ds, "Partner")

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top