conexion base de datos visual studio
Publicado por Benito (1 intervención) el 12/04/2019 22:22:45
Buenas tardes queria platicarles mi problema y saber si alguien tendria una solucion lo que pasa es que estoy realizando una base de datos en el de servidor de XAMPP y la parte de la programacion de Visual Studio 2017 pero me marca un error :
Authentication to host 'localhost' for users 'root' using method 'mysql_native_password' failes with message: Reading from the stream has failed
abajo esta mi codigo
saludos
Authentication to host 'localhost' for users 'root' using method 'mysql_native_password' failes with message: Reading from the stream has failed
abajo esta mi codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
namespace test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
DBconnection();
}
private void DBconnection()
{
string ConnectString = "datasource = localhost; username= root; password=; database= prueba";
MySqlConnection DBConnect = new MySqlConnection(ConnectString);
try
{
DBConnect.Open();
MessageBox.Show("Estas Conectado");
}catch(Exception e)
{
MessageBox.Show(e.Message);
}
}
}
}
saludos
Valora esta pregunta


0