If the dll is not in the GAC it has to be in the the same folder as your exe when the program is run or the program can't find it. I don't know if it is or not for you but that could be the problem
On Mon, Dec 15, 2008 at 12:48 AM, aifaz <aifaz.k...@gmail.com> wrote: > > hi > > i am using Mono 2.0 mysql 5.0 as backend. when i am store MySqlData.dll in > Global Assembly Cache > it worked fine. but when i use MySqlData.dll as reference i got an error > after executing .exe file > and compiled sucessfully > > here is my code > for acess database > > > using System; > using Gtk; > using Glade; > using System.Data; > using MySql.Data.MySqlClient; > > > > > > public class DBAcess > { > [Widget] Window window1; > // [Widget] TreeView treeview1; > [Widget] Label label1; > public DBAcess() > { > Gtk.Application.Init(); > Glade.XML guiXml = new Glade.XML("DBAcess.glade", "window1", null); > guiXml.Autoconnect(this); > > String connectionstring ="Server=192.168.0.23;" + > "Database=luxsoft_payroll;User > ID=swarup;Password=swarup;pooling=false"; > try > { > MySqlConnection conn = new MySqlConnection(connectionstring); > conn.Open(); > MySqlDataAdapter da = new MySqlDataAdapter("select * from > company", conn); > DataSet ds = new DataSet(); > da.Fill(ds); > //for (int iC = 0; iC < ds.Tables[0].Rows.Count; iC++) > //{ > label1.Text = > ds.Tables[0].Rows[0]["company_name"].ToString(); > //} > // > Console.WriteLine(ds.Tables[0].Rows[0]["company_id"].ToString()); > //Gtk.TreeViewColumn firstcolumn = new Gtk.TreeViewColumn(); > > //firstcolumn.Title = > ds.Tables[0].Rows[0]["company_id"].ToString(); > > //Gtk.TreeViewColumn secndColumn = new Gtk.TreeViewColumn(); > //secndColumn.Title = > ds.Tables[0].Rows[0]["company_name"].ToString(); > > //treeview1.AppendColumn(firstcolumn); > //treeview1.AppendColumn(secndColumn); > > conn.Close(); > window1.ShowAll(); > Gtk.Application.Run(); > > } > catch (Exception ex) > { > Console.Error.WriteLine(ex); > } > > } > public static void Main() > { > new DBAcess(); > } > } > > > > i complied as > mcs -r:System.Drawing -r:System.Data -r:MySql.Data -lib:"D:\aifaz\MonoUI" > -r:gtk-sharp -r:glade-sharp -lib:"C:\Program > Files\Mono-2.0\lib\mono\gtk-sharp-2.0" DBAcess.cs > compiled sucessfully > after typing this command > mono DBAcess.exe > > i got error > > D:\aifaz\MonoUI>mono DBAcess.exe > > ** (DBAcess:4076): WARNING **: The class > System.Collections.Generic.Dictionary`2 > could not be loaded, used in mscorlib, Version=2.0.0.0, Culture=neutral, > Public > KeyToken=b77a5c561934e089 > Stacktrace: > > at MySql.Data.Common.DBConnectionString.Parse (string) <0xffffffff> > at MySql.Data.Common.DBConnectionString.Parse (string) <0x000c2> > at MySql.Data.Common.DBConnectionString.SetConnectionString (string) > <0x00011> > > at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString (string) > <0x000 > 24> > at MySql.Data.MySqlClient.MySqlConnection..ctor (string) <0x00016> > at (wrapper remoting-invoke-with-check) > MySql.Data.MySqlClient.MySqlConnection > ..ctor (string) <0xffffffff> > at DBAcess..ctor () <0x00063> > at DBAcess.Main () <0x00016> > at (wrapper runtime-invoke) System.Object.runtime_invoke_void > (object,intptr,i > ntptr,intptr) <0xffffffff> > > This application has requested the Runtime to terminate it in an unusual > way. > Please contact the application's support team for more information. > > > i have attached error image > i hope for quick response > Thank You > -- > View this message in context: > http://www.nabble.com/Error-Messege-while-executing-application-exe-tp21009038p21009038.html > Sent from the Mono - Gtk# mailing list archive at Nabble.com. > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > _______________________________________________ Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/gtk-sharp-list