Does anybody know if I need to do anything to get Vegas to see a 3rd party assembly reference?
I'm trying to have a Vegas script interact with a mySQL database using mysql.data.dll which I have installed and have working perfectly in other compiled c# apps. I'm using VS2010.
Example script code:
using System;
using System.IO;
using System.Windows.Forms;
using Sony.Vegas;
using MySql.Data;
using MySql.Data.MySqlClient;
class EntryPoint
{
Vegas vegas;
public void FromVegas(Vegas _vegas)
{
vegas = _vegas;
addData("ONE", "TWO", "THREE");
}
private void addData(string _XXX, string _YYY, string _ZZZ)
{
MySqlConnection conn = null;
MySqlDataReader rdr = null;
conn = new MySqlConnection(@"server=10.1.1.1; userid=JAN; password=PASSWORD; database=projectdb;");
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "INSERT INTO Table(XXX, YYY, ZZZ) VALUES(@XXX, @YYY, @ZZZ)";
cmd.Prepare();
cmd.Parameters.AddWithValue("@XXX", _XXX);
cmd.Parameters.AddWithValue("@YYY", _YYY);
cmd.Parameters.AddWithValue("@ZZZ", _ZZZ);
cmd.ExecuteNonQuery();
if (rdr != null) rdr.Close();
if (conn != null) conn.Close();
}
}
Everything works fine in VS. I know the c# code is good as it's cut and pasted from other working projects. But when I run the script in Vegas it can't find the mysql reference. It complains:
"The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)"
I'm guessing I need to copy the dll file somewhere for vegas to find it?
I'm trying to have a Vegas script interact with a mySQL database using mysql.data.dll which I have installed and have working perfectly in other compiled c# apps. I'm using VS2010.
Example script code:
using System;
using System.IO;
using System.Windows.Forms;
using Sony.Vegas;
using MySql.Data;
using MySql.Data.MySqlClient;
class EntryPoint
{
Vegas vegas;
public void FromVegas(Vegas _vegas)
{
vegas = _vegas;
addData("ONE", "TWO", "THREE");
}
private void addData(string _XXX, string _YYY, string _ZZZ)
{
MySqlConnection conn = null;
MySqlDataReader rdr = null;
conn = new MySqlConnection(@"server=10.1.1.1; userid=JAN; password=PASSWORD; database=projectdb;");
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = "INSERT INTO Table(XXX, YYY, ZZZ) VALUES(@XXX, @YYY, @ZZZ)";
cmd.Prepare();
cmd.Parameters.AddWithValue("@XXX", _XXX);
cmd.Parameters.AddWithValue("@YYY", _YYY);
cmd.Parameters.AddWithValue("@ZZZ", _ZZZ);
cmd.ExecuteNonQuery();
if (rdr != null) rdr.Close();
if (conn != null) conn.Close();
}
}
Everything works fine in VS. I know the c# code is good as it's cut and pasted from other working projects. But when I run the script in Vegas it can't find the mysql reference. It complains:
"The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)"
I'm guessing I need to copy the dll file somewhere for vegas to find it?