Message 1 of 1
MySQL Ilogic connect script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a MS SQL Connection Ilogic Script and I am trying to make a MySQL Connection Ilogic Script so i also can connetct to my MySQL Database server on a linux machine, i have tried different methods but i can get it working
This is the MS SQL Connection Ilogic Script that i want to convert for Mysql
AddReference "System.Data"
AddReference "System.Core"
AddReference "System.Xml"
Imports System.Data.OleDb
Imports System.Data
Imports System.Xml
Dim Table_ As String = RuleArguments("TableName")
Dim PartNumber As String = RuleArguments("PN")
Dim Connection As OleDb.OleDbConnection = New OleDb.OleDbConnection("Provider=SQLNCLI11;[Hidden];Persist Security Info=True;User ID=[Hidden];PWD=[Hidden])
Dim Command As New OleDb.OleDbCommand
Dim ds As New DataSet
Dim query As String = ("SELECT * FROM [" + Table_ + "]")
'Dim rowo As System.Data.DataRow
'Dim Count As Integer
Connection.Open() 'open up a connection to the database
Command.Connection = Connection
Dim cmd As New OleDbCommand(query, Connection)
Dim da As New OleDbDataAdapter(cmd)
da.Fill(ds, Table_)
Connection.Close()
Dim t1 As DataTable = ds.Tables(Table_)
Dim row As DataRow
Dim Found As Integer = 0
For Each row In t1.Rows
If row(0) = Partnumber
iProperties.Value("Project", "Stock Number") = Row(1)
End If
Next
Thank you.