ERROR DE CONEXAO MYSQL COM C#
Olá amigos, estou me aventurando no C# , mas não consigo efetuar a conexao com um db mysql esterno..
por favor, o que está faltando nessa classe ?
obs: já instalei o conector .net
banco de dados já criado
obrigado pela atenção...
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace SysGestor.Net
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
MySqlConnection BdConn;
BdConn = new MySqlConnection();
BdConn.ConnectionString = [Ô]server=mysql5.XXXXXXX.com.br;port=3307;uid=XXXXXX;pwd=XXXXXX;database=XXXXXXXXX[Ô]
try
{
//Abre Conexão
BdConn.Open();
}
catch
{
MessageBox.Show([Ô]ImpossÃvel estabelecer conexão[Ô],[Ô]informação[Ô],MessageBoxButtons.OK,MessageBoxIcon.Information);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Modulo_Principal());
}
}
}
por favor, o que está faltando nessa classe ?
obs: já instalei o conector .net
banco de dados já criado
obrigado pela atenção...
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace SysGestor.Net
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
MySqlConnection BdConn;
BdConn = new MySqlConnection();
BdConn.ConnectionString = [Ô]server=mysql5.XXXXXXX.com.br;port=3307;uid=XXXXXX;pwd=XXXXXX;database=XXXXXXXXX[Ô]
try
{
//Abre Conexão
BdConn.Open();
}
catch
{
MessageBox.Show([Ô]ImpossÃvel estabelecer conexão[Ô],[Ô]informação[Ô],MessageBoxButtons.OK,MessageBoxIcon.Information);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Modulo_Principal());
}
}
}
há este erro aparece..
Warning 2 The referenced assembly [Ô]MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL[Ô] could not be resolved because it has a dependency on [Ô]System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a[Ô] which is not in the currently targeted framework [Ô].NETFramework,Version=v4.0,Profile=Client[Ô]. Please remove references to assemblies not in the targeted framework or consider retargeting your project. SysGestor.Net
mas eu já referenciei o MySql.Web
Warning 2 The referenced assembly [Ô]MySql.Web, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL[Ô] could not be resolved because it has a dependency on [Ô]System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a[Ô] which is not in the currently targeted framework [Ô].NETFramework,Version=v4.0,Profile=Client[Ô]. Please remove references to assemblies not in the targeted framework or consider retargeting your project. SysGestor.Net
mas eu já referenciei o MySql.Web
Tópico encerrado , respostas não são mais permitidas