Send sql command using vb.net to openedge

Here's a sample that just throws it to a datagrid for testing:

Dim
cn As OdbcConnection

cn = New OdbcConnection("Driver={Progress OpenEdge 10.2A driver};Host=yourhostname;PORT=yourport;DB=yourdatabasename;UID=youruserid;PWD=yourpassword")

'or create an ODBC dsn on the machine and use this --> cn = New OdbcConnection("DSN=dsnname;UID=userid;PWD=password")

Dim mystring AsString = "select AdCharge.AdNumber, AdCharge.CustomerID, " & _
" AdSchedule.BillDate, AdSchedule.PublicationID, " & _
" AdCharge.ZoneID, " & _
" AdCharge.AdjustmentApplyChargeID, " & _
"from PUB.AdSchedule " & _
"inner join PUB.AdCharge " & _
"on AdSchedule.adnumber = AdCharge.Adnumber " & _
"where AdSchedule.PublishDate = TO_DATE ('6/13/2011') and AdSchedule.Adnumber = '22481006' "
Dim cmd AsOdbcCommand = NewOdbcCommand(mystring, cn)
Dim dsCACHE AsNewDataSet
Dim dtaCache AsNewOdbcDataAdapter(cmd)

Try

dtaCache.Fill(dsCACHE,"AdCustomer")dg1.DataSource = dsCACHE.Tables("AdCustomer")

...
 
Back
Top