473,394 Members | 1,715 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,394 software developers and data experts.

Mono/C# referencing assemblies using code behind

I get this error:

The type or namespace name `MySql' could not be found. Are you missing a using directive?

I've already installed Mysql.Data.dll in GAC.

Im using the "src" tag instead of "CodeBehind" cause im not using VS just a plain text editor in Ubuntu edgy.
May 25 '07 #1
3 1695
Don't you want to use the namespace and assembly attribiutes instead of the src attribute.

Post a snippet man.
May 25 '07 #2
heres my aspx page:

<%@ Page Language="C#" src="nns2007.aspx.cs" Inherits="_nns2007" %>
<html>
<title>The 7th National Nutrition Survey, year 2007</title>
<head>National Nutrition Survey 2007</head>
<body>
<form id="form1" runat="server">
<table>
<tr>
<td><input type="text" id="txtareacode" maxlenght="25"></td>
</tr>
<tr>
<td><input type="text" id="txtht" maxlenght="5"></td>
</tr>
<tr>
<td><input type="text" id="txtwt" maxlenght="5"></td>
</tr>

</table>
</form>
</body>

</html>


my code behind:

using System;
using System.Data;
using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;
using MySql.Data;
using MySql.Data.MySqlClient;
using System.Web.UI.HtmlControls;

public partial class _nns2007 : System.Web.UI.Page
{




void connectoDB(string sql)
{
string connectionString =
"Server=localhost;" +
"Database=anthro;" +
"User ID=root;" +
"Password=sabukot;" +
"Pooling=false";
IDbConnection dbcon;
dbcon = new MySqlConnection(connectionString);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
}

void AnthroInsert()
{

string a_INSERT = "INSERT INTO anthro(areacode,height,weight) VALUES (txtarea,txtht,txtwt)";

connectoDB(a_INSERT);
}


protected void btnInsert_Click (object sender, EventArgs e)
{
AnthroInsert();
}

}


by the way, what version of mysql connector should i use 1.0.5? i
May 25 '07 #3
Likely the mysql assembly does not have a strong name for installation into the GAC.
Try adding it as a direct reference to your project.

If that works, peruse "How To Install an Assembly into the Global Assembly Cache in Visual C# .NET" in your .Net documentation
May 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Everything Jute ! | last post by:
Programmers everyday are making a tragic error by not learning mono. Mono is te standard .net implementation for Windos and Linux. Learning mono is the key to writing fast, OOP, cross platform...
12
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its...
16
by: PromisedOyster | last post by:
Hi I have a situation where I want to use circular referencing. I have cut down the example for demonstration purposes. Say we have one executable (main.exe) and two DLLS (A1.dll and A2.dll)....
2
by: David Brewer | last post by:
Hi, as far as I know, neither Shares Source CLI from Microsoft nor Mono can execute a CLR executable generated by Microsoft Visual C++ .NET, which is not a .NET implementation but just "managed...
4
by: Ian Meakin | last post by:
I have a page called admin.aspx and it uses admin.aspx.cs as it's code behind file. When developing the application on my localhost using VS.NET i reference thsi file using...
11
by: Jan | last post by:
I'm using the CSharpCodeProvider to buils some assemblies @ runtime which are never saved as files (cp.GenerateInMemory = true;). The generated assemblies are hierachically dependent on each other...
5
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
I am experiencing a lot of speed issues on initial app loads where we are referencing 3rd party 1.1 assemblies from 2.0 code. Those 1.1 assemblies reference things like System.Windows.Forms...
1
by: Dave Anson | last post by:
What is the recommended practice for referencing assemblies in a project from other solutions? I am using Visual Studio 2005 Team System. I have several assemblies in another solution which will...
1
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.