MySql reference - c#

using MySql.Data.MySqlClient;
Ive followed this guide to install the reference. How do I add a reference to the MySQL connector for .NET?.
When the reference is added, all errors go away, but when I try to run it, I get this error:
"The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference)"
As you can see from the screencap, the reference shows up under 'references'.

Ok Sorted it, If you use framwork 4, like me, you need to use the reference version 6.3.5.0
Thanks

Related

DevExpress and missed reference

When I am trying to change references in my project from DevExpress 9.2 to DevExpress 11.2 for all of them, I am getting follow exceptions in one of my classes:
<...> The type or namespace name 'DevExpress' could not be found (are you missing a using directive or an assembly reference?) <...>
<...>The type or namespace name 'LayoutControl' could not be found (are you missing a using directive or an assembly reference?) <...>
I am using following references:
DevExpress.Data
DevExpress.Utils
DevExpress.XtraBars
DevExpress.XtraEditors
DevExpress.XtraGrid
DevExpress.XtraLayout
DevExpress.XtraNavBar
When I am using v9.2 – everything is OK, but when I am changing references – I am getting following underlining:
using DevExpress.XtraLayout;
public static string GetLayout(LayoutControl layoutControl)
So, how can I change that references properly?
I think I found: DevExpress 11.2 just not working with .NET 2.0. If you have such problem, you need to change your project's target framework at least to .NET 3.5, or, of course, you can just forget about DevExpress 11.2, and use older versions of it. :)

Oracle reference for C#

I am trying to connect to Oracle via C# but I am missing a reference to make this work:
using Oracle.DataAccess.Client;
The error is of course:
The type or namespace name 'Oracle' could not be found (are you
missing a using directive or an assembly reference?)
Since this is the standard error for missing a reference.
I am using Oracle 11.2.0.
I tried to find the reference online but I can't manage to find a working one. Also is there anything more I need in C# to connect to an Oracle database?
Where do I find the right reference?
Make sure you have installed the Oracle .Net stuff: ODP.NET.
This will include some .NET wrapper classes to the underlying Oracle client. If memory serves, they should be placed in GAC so should be easy to find from the VS.NET add references window.

Connection of c# with mysql

I want to connect through code c# with wamp mysql but have some problem...
Under MySql of this line
using MySql.Data.MySqlClient;
I have error
Error 1
The type or namespace name 'MySql' could not be found (are you
missing a using directive or an assembly reference?)
I have searched this problem from net but according to that solutions, my microsoft visual 2008 should have mysql.data and web.data in add reference but I don't have these references
If any one have any alternative solution then please help me
thanks
you need to run through the installation of the mysql connector libraries, then add a reference to them in your project. after that, you should be able to add the using statement for MySql.Data.MySqlClient.
You have to add MySQL as a reference.
http://msdn.microsoft.com/en-us/library/7314433t%28v=vs.80%29.aspx
Of course, you'll have to install/download them first.
Make sure that you have the necessary assemblies referenced in your project (in Solution Explorer there is a References section. You can view and add through that).
Also, if you do have the above complete, then you need to have using yourNameSpace;.

Missing reference

In project i have reference to Microsoft.Office.Word.Server
and in code i have method that takes argument of type ConversionJob, but when i try to compile it i have an errors
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
The type or namespace name 'ConversionJob' could not be found (are you missing a using directive or an assembly reference?)
but when a press f12 on ConversionJob it tooks me to the class defenition
using Microsoft.Office.Word.Server.Service;
using Microsoft.SharePoint;
using System;
namespace Microsoft.Office.Word.Server.Conversions
{
public class ConversionJob
{
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy, ConversionJobSettings settings);
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy);
...
what is wrong?
target framework is .Net framework 3.5
Solution
Ive solve the problem. I look to the output and there was message:
Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "<assembly reference>" could not be resolved because it has an indirect dependency on the framework assembly "<assembly" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "<assembly>" or retarget your application to a framework version which contains "<assembly>"
i try to find solution in google and - > http://www.sanderstechnology.com/2011/warning-msb3268-you-are-about-to-experience-pain/10646/#.TtYrXGP20Z8
Check the target framework of your application, might be you´re building for the client profile but the referenced assembly requires the full framework.
Try changing the "Target Framework" to be ".NET Framework 4" instead of ".NET Framework 4 Client Profile".
Project Properties -> Application Tab -> Target Framework
You likely need to delete (MAKE SURE TO BACK IT UP) the 12.x.x.x .dll in your GAC folder, and make sure you are referencing the 14.x.x.x in your solution.
If you look at the project references, is it finding the assembly? The icon will look different if it can't resolve it.
1.Try to delete and then manualy add the reference (sometimes it helps - VS losting needed dll but not show it with another sign if not clean)
if 1. ok then backup and try to remove from GAC folder (to understatnd from where it calls assembly)
Probably you have a namespace or class with the name Office somewhere in your code. The compiler uses your namespace instead Office.
In other words I think you have a name collision with your project or any of the references you have in it.
Please investigate for overlapping namespaces / classes.

The type or namespace name 'XmlConfigurator' could not be found

The type or namespace name 'XmlConfigurator' could not be found (are you missing a using directive or an assembly reference?)
Am I missing a namespace???
You have to add log4net.dll to your project and the using log4net.Config; namespace
Your missing dll. Right click on your project and Add Reference... point to correct dll.
There is the possibility that you have not added the dll. This would require right clicking your project and adding the reference DLL. There is one other step that wasn't mentioned in the previous answers that I found relevant.
There is the possibility that you are not using the correct runtime. I found that log4net requires a full profile. For instance the client profile for .NET 4 will generate this error but if you use the full profile you will not experience this.

Categories

Resources