473,383 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

FileNotFoundException was Handled

I wrote my program like this and its using c# mysqldriver for
connecting mysql but after pushing the connet button im taking this
error
what must i do

Error:

File or assembly name 'MySQLDriverCS, Version=3.0.1735.36021,
Culture=neutral, PublicKeyToken=172f94dfb0faf263', or one of its
dependencies, was not found.
and my code is like this
[code:1:278b9f2036]
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using MySQLDriverCS;
public class baglanti : Form
{
private Button btn;
private TextBox text1;
private TextBox text2;
private Label label1, label2;
private RichTextBox txt1;
public baglanti()
{
String path = @"C:\Documents and
Settings\VampirHuma\My Documents\Visual
Studio\Projects\connector\connector\sylcn.jpg";
this.Size = new Size(400, 300);
this.Location = new Point(140, 200);
this.Text = "Sylveria Baglanti Programi";
this.BackgroundImage = new Bitmap(path);
this.MaximizeBox = false;
txt1 = new RichTextBox();
txt1.Size = new Size(100, 100);
txt1.Location = new Point(8, 160);
txt1.Text = "";

label1 = new Label();
label1.Text = "Kullanici Adi:";
label1.Size = new Size(70, 20);
label1.Location = new Point(8, 50);

label2 = new Label();
label2.Text = "Sifre:";
label2.Size = new Size(70, 20);
label2.Location = new Point(8, 75);

text1 = new TextBox();
text1.Size = new Size(100, 15);
text1.Location = new Point(80, 50);
text1.MaxLength = 20;
text2 = new TextBox();
text2.Size = new Size(100, 15);
text2.Location = new Point(80, 75);
text2.MaxLength = 20;

btn = new Button();
btn.Size = new Size(50, 25);
btn.Text = "Baglan";
btn.Location = new Point(8, 100);
btn.Click += new EventHandler(btn_clicked);

this.Controls.Add(label1);
this.Controls.Add(label2);
this.Controls.Add(text1);
this.Controls.Add(text2);
this.Controls.Add(txt1);
this.Controls.Add(btn);

}

public void sorgu(String u_name, String pw)
{
MySQLConnection Dbconn;
Dbconn = new MySQLConnection(new
MySQLConnectionString("localhost", "account",
"root", "root").AsString);
Dbconn.Open();

System.Data.DataTable dt = new MySQLSelectCommand(Dbconn,
new string[] { "username",
"password" }, new string[] {
"accounts" }, new object[,] { {
"username", "=", u_name } }, null,
null).Table;

if (dt.Rows.Count != 0)
{
txt1.Text = "Kullanici Adi ve Sifre
Dogrulandi";
}
else
{
txt1.Text = "Kullanici Adi veya Sifre Hatali";
}

}

public void btn_clicked(object ob, EventArgs e)
{
sorgu(this.text1.Text,this.text1.Text); //here the
error happens
}

public static void Main()
{
Application.Run(new baglanti());
}
}
[/code:1:278b9f2036]

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #1
3 2308
You are referencing an assembly called MySQLDriverCS.dll (most likely).
Either put that dll in the same directory as your application, or
depending on your needs, add it to the GAC.

Regards,
Joakim

Dakkar wrote:
I wrote my program like this and its using c# mysqldriver for
connecting mysql but after pushing the connet button im taking this
error
what must i do

Error:

File or assembly name 'MySQLDriverCS, Version=3.0.1735.36021,
Culture=neutral, PublicKeyToken=172f94dfb0faf263', or one of its
dependencies, was not found.
and my code is like this
[code:1:278b9f2036]
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using MySQLDriverCS;
public class baglanti : Form
{
private Button btn;
private TextBox text1;
private TextBox text2;
private Label label1, label2;
private RichTextBox txt1;
public baglanti()
{
String path = @"C:\Documents and
Settings\VampirHuma\My Documents\Visual
Studio\Projects\connector\connector\sylcn.jpg";
this.Size = new Size(400, 300);
this.Location = new Point(140, 200);
this.Text = "Sylveria Baglanti Programi";
this.BackgroundImage = new Bitmap(path);
this.MaximizeBox = false;
txt1 = new RichTextBox();
txt1.Size = new Size(100, 100);
txt1.Location = new Point(8, 160);
txt1.Text = "";

label1 = new Label();
label1.Text = "Kullanici Adi:";
label1.Size = new Size(70, 20);
label1.Location = new Point(8, 50);

label2 = new Label();
label2.Text = "Sifre:";
label2.Size = new Size(70, 20);
label2.Location = new Point(8, 75);

text1 = new TextBox();
text1.Size = new Size(100, 15);
text1.Location = new Point(80, 50);
text1.MaxLength = 20;
text2 = new TextBox();
text2.Size = new Size(100, 15);
text2.Location = new Point(80, 75);
text2.MaxLength = 20;

btn = new Button();
btn.Size = new Size(50, 25);
btn.Text = "Baglan";
btn.Location = new Point(8, 100);
btn.Click += new EventHandler(btn_clicked);

this.Controls.Add(label1);
this.Controls.Add(label2);
this.Controls.Add(text1);
this.Controls.Add(text2);
this.Controls.Add(txt1);
this.Controls.Add(btn);

}

public void sorgu(String u_name, String pw)
{
MySQLConnection Dbconn;
Dbconn = new MySQLConnection(new
MySQLConnectionString("localhost", "account",
"root", "root").AsString);
Dbconn.Open();

System.Data.DataTable dt = new MySQLSelectCommand(Dbconn,
new string[] { "username",
"password" }, new string[] {
"accounts" }, new object[,] { {
"username", "=", u_name } }, null,
null).Table;

if (dt.Rows.Count != 0)
{
txt1.Text = "Kullanici Adi ve Sifre
Dogrulandi";
}
else
{
txt1.Text = "Kullanici Adi veya Sifre Hatali";
}

}

public void btn_clicked(object ob, EventArgs e)
{
sorgu(this.text1.Text,this.text1.Text); //here the
error happens
}

public static void Main()
{
Application.Run(new baglanti());
}
}
[/code:1:278b9f2036]

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 16 '05 #2
What is GAC?
Joakim Karlssonwrote: You are referencing an assembly called MySQLDriverCS.dll (most
likely). Either put that dll in the same directory as your application, or
depending on your needs, add it to the GAC.

Regards,
Joakim

Dakkar wrote:
I wrote my program like this and its using c# mysqldriver for
connecting mysql but after pushing the connet button im taking this
error
what must i do

Error:

File or assembly name 'MySQLDriverCS, Version=3.0.1735.36021,
Culture=neutral, PublicKeyToken=172f94dfb0faf263', or one of its
dependencies, was not found.
and my code is like this

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Drawing;
using MySQLDriverCS;
public class baglanti : Form
{
private Button btn;
private TextBox text1;
private TextBox text2;
private Label label1, label2;
private RichTextBox txt1;
public baglanti()
{
String path = @"C:\Documents and
Settings\VampirHuma\My Documents\Visual
Studio\Projects\connector\connector\sylcn.jpg";
this.Size = new Size(400, 300);
this.Location = new Point(140, 200);
this.Text = "Sylveria Baglanti Programi";
this.BackgroundImage = new Bitmap(path);
this.MaximizeBox = false;
txt1 = new RichTextBox();
txt1.Size = new Size(100, 100);
txt1.Location = new Point(8, 160);
txt1.Text = "";

label1 = new Label();
label1.Text = "Kullanici Adi:";
label1.Size = new Size(70, 20);
label1.Location = new Point(8, 50);

label2 = new Label();
label2.Text = "Sifre:";
label2.Size = new Size(70, 20);
label2.Location = new Point(8, 75);

text1 = new TextBox();
text1.Size = new Size(100, 15);
text1.Location = new Point(80, 50);
text1.MaxLength = 20;
text2 = new TextBox();
text2.Size = new Size(100, 15);
text2.Location = new Point(80, 75);
text2.MaxLength = 20;

btn = new Button();
btn.Size = new Size(50, 25);
btn.Text = "Baglan";
btn.Location = new Point(8, 100);
btn.Click += new EventHandler(btn_clicked);

this.Controls.Add(label1);
this.Controls.Add(label2);
this.Controls.Add(text1);
this.Controls.Add(text2);
this.Controls.Add(txt1);
this.Controls.Add(btn);

}

public void sorgu(String u_name, String pw)
{
MySQLConnection Dbconn;
Dbconn = new MySQLConnection(new
MySQLConnectionString("localhost", "account",
"root", "root").AsString);
Dbconn.Open();

System.Data.DataTable dt = new MySQLSelectCommand(Dbconn,
new string[] { "username",
"password" }, new string[] {
"accounts" }, new object[,] { {
"username", "=", u_name } }, null,
null).Table;

if (dt.Rows.Count != 0)
{
txt1.Text = "Kullanici Adi ve Sifre
Dogrulandi";
}
else
{
txt1.Text = "Kullanici Adi veya Sifre Hatali";
}

}

public void btn_clicked(object ob, EventArgs e)
{
sorgu(this.text1.Text,this.text1.Text); //here the
error happens
}

public static void Main()
{
Application.Run(new baglanti());
}
}
*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*[/quote:0f128a5ca2]


*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #3
Dakkar wrote:
What is GAC?


The Global Assembly Cache (GAC) is used to store assemblies that are to
be shared among applications on a box.

You can read about it here:

http://msdn.microsoft.com/library/de...emblycache.asp

Regards,
Joakim
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ulf | last post by:
Hello, After I got a FileNotFoundException in my real life CSharp code, I nailed it down to the following line: System.EnterpriseServices.ResourcePool rp = new...
2
by: Michael Sanford | last post by:
I'm getting a Sysmte.IO.FileNotFoundException when executing the code below. It is straight from the example. This works on one machine, but not the other. Other benign calls invoke the same...
0
by: Daylor | last post by:
any suggestions, why FileNotFoundException is throw , when im try to send object from appdomain to other ? (the object inherits MarshalByRefObject) i dont have a clue what the VS.2003 want...
4
by: Brian Keating | last post by:
Hi there, I'm wondering is there any way i can gracefully handly the System.IO.FileNotFound exception. Let me explain my situation. I've got a window forms app. I've exception handlers...
5
by: MattC | last post by:
Hi, I am getting the following error: System.IO.FileNotFoundException: C:\Dreamtxt\WebSites\mysite\www\feedback.aspx at System.Web.UI.TemplateParser.GetParserCacheItem() at...
3
by: James | last post by:
Hi guys Do you ever get the exception in Managed C++? How can I know which file or dll is missed?
0
by: Peter Vestergaard | last post by:
Hi, I am running VS .Net 2005. I have an application in which one of the classes are having a member that is an instance of a class defined in a managed C++ dll. As soon as I try to create an...
6
by: nagar | last post by:
In certain occasions I get an exception when trying to read the shown path for the active explorer window When I instantiate the object SHDocVw.ShellWindows shell = new ShellWindowsClass(); ...
2
by: =?Utf-8?B?c2FtMDFt?= | last post by:
I have a remoting application that was developed on a Windows XP SP2 machine with VS2005 SP1. I finally got everything deployed using Wix 3.0, and it works great. Problem is, when I install the msi...
2
by: bbindae | last post by:
I am trying to check whether XmlTextReader reads the xml file successfully or not. MSDN says that XmlTextReader raise the FileNotFoundException when it cannot find the file to read. Here is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.