using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;
using System.Windows.Forms;
using DPUruNet;
using System.Drawing.Imaging;
using System.Drawing;
namespace UareUBiometrics
    class HelperFunctions
        private static Fmd[] fmds;
        private static Fmd[] allDBFmds;
        public static Fmd[] GetAllFmds
            get { return allDBFmds; }
        private static string[] allUserNames;
        public static string[] GetAllUserNames
            get { return allUserNames; }
        private static int[] allfingerIDs;
        public static int[] GetallfingerIDs
            get { return allfingerIDs; }
        public static MySqlDataReader ConnectDBnExecuteSelectScript(string Script)
            string connectionString = "server=localhost;User Id=root;database=customerInfo;Password=";
            MySqlDataReader dataReader = null;
            MySqlConnection conn = new MySqlConnection(connectionString);
                MySqlCommand sqlCommand = new MySqlCommand(Script, conn);
                dataReader = sqlCommand.ExecuteReader(CommandBehavior.CloseConnection);
            catch (MySqlException ex)
                MessageBox.Show("Error opening connection" + ex.Message);
            return dataReader;

Edited by pritaeas: Moved.

4 Years
Discussion Span
Last Post by samsylvestertty

pritaeas - yes i also that ,but when i use that in vb .it comes with an error

Edited by kyle.santelices.31: spelling


I don't use MySQL but based on this , the connection string looks wrong. It looks more like a SQL Server connection string.


Does the root account exist in your local host MySQL server?
Does the root account exist without a password?

for 1 & 2 try to login to mysql with the username as root and empty string '' as password

If you could login with the given credentials
Try giving a password to the root account granting permissions in the MySQL command prompt

I hope the GRANT statement goes like this

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY somepassword

replace somepassword with your password

and change the connection string

string connectionString = "server=localhost;User Id=root;database=customerInfo;Password=somepassword;

Edited by samsylvestertty

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.