1. Hey guys,

    Anyone care to give me a quick tutorial on how to connect and insert data to a MySQL db?
    I'm familiar with SQL, just not in C#.

    I've tried some of the code found on the forum, but i keep getting the following error:
    Code:
    error CS0234: The type or namespace name `MySql' does not exist in the namespace `Oxide.Ext'. Are you missing an assembly reference?
     
  2. Wulf

    Wulf Community Admin

  3. Exactly the one i was looking at, but as you can see from my error, it's missing that reference.

    I'm got using Oxide.Core;
    And i call this lines:
    Code:
    private readonly Ext.MySql.Libraries.MySql _mySql = Interface.GetMod().GetLibrary<Ext.MySql.Libraries.MySql>();
    private Ext.MySql.Connection _mySqlConnection;
     
  4. Wulf

    Wulf Community Admin

    Do you have the using statement for it at the top? I'd also recommend setting up Visual Studio 2015, it'd essentially fix it for you.
     
  5. The using statement is on top (right after using system) and i do use VS15...
    [DOUBLEPOST=1449279590][/DOUBLEPOST]Oh, and looks like i posted in the wrong forum, could you move it over to dev ?
    [DOUBLEPOST=1449339533,1449278196][/DOUBLEPOST]Can anyone confirm that the MySQL addon works, and maybe have a quick look at my previous posts and see what i might be doing wrong? Thanks
     
  6. Wulf

    Wulf Community Admin

    It should work fine, there are a few plugins that use it.
     
  7. Okey, I've copied the entire example from MySQL Extension and it works. So its something in my code. I'll mark this as solved, and follow opp with the solution when i figure it out.
    [DOUBLEPOST=1449360374][/DOUBLEPOST]Oh for fuck sake.

    Turns out the comment on the first line is necessary. I thought the compiler skipped all comment lines...

    Code:
    // Reference: Oxide.Ext.MySql
    Did not know that. Hope this can help someone else with the same issue tho, and thanks for your replies Wulf.
     
  8. Wulf

    Wulf Community Admin

    That's called a Magic Reference, and is only needed if Oxide doesn't include it as default reference. Magic References can be used to import any allowed DLL that the server has loaded.
     
  9. I am trying for a plugin on my server, and this same problem occurred with 'Oxide.Ext.Mysql' I would like to know how I can get this extension, I am new to the subject, thank you for the attention.
     
  10. Wulf

    Wulf Community Admin

    Oxide.Core.MySql, this thread is very old. :p