title: How do I access MySql database in C#.NET with WPF?
body: <p>Please advise me. I am trying to develop Windows Application in WPF with Mysql server database. </p>
  
  <p>Which approach I have to use to create connection establish on the Mysql database?</p>
  
  <p>1) Entity Framework
  OR
  2) ADO.NET
  OR
  3) Other one</p>
  
  <p>The Admin computer need to install mysql database on his computer and then access the mysql database to another (10 or more) client systems which are under network connected.</p>
  
  <p>Here, just one MySql database inside admin computer only. And all other client machines are accessing MySql database by admin's computer IP address. The IP connection string is like this:-</p>
  
  <pre><code> @"Data Source=10.0.0.101
  </code></pre>
  
  <p>One of other matter is, the customer demanding that, when installing .exe file on client machine, then should have to automatically install mysql server database (ie, xampp or other ect..) also.</p>
  
  <p>How can I do this?</p>
  
  <p>I have tried, ADO.NET C# instead EF to connect mysql for wpf windows application. like that :-</p>
  
  <pre><code>public void AddUserList( UserSetUp user)  
      {  
  
          dbConnection.Open();  
          string query = "INSERT INTO Tble_UserSetUp (FirstName, SurName, Email, PhoneNumber, UserName, Password,Computer_Name,IP_Address,CreatedBy, CreatedDate,IsActive,Function,Department) VALUES (@FirstName, @SurName, @Email, @PhoneNumber, @UserName, @Password,@Computer_Name,@IP_Address,@CreatedBy, @CreatedDate,@IsActive,@Function,@Department)";  
          MySqlCommand insertSQL = new MySqlCommand(query, (MySqlConnection)dbConnection);  
          insertSQL.Parameters.AddWithValue("@FirstName", user.FirstName);  
          insertSQL.Parameters.AddWithValue("@SurName", user.SurName);  
          insertSQL.Parameters.AddWithValue("@Email", user.Email);  
          insertSQL.Parameters.AddWithValue("@PhoneNumber", user.PhoneNumber);  
          insertSQL.Parameters.AddWithValue("@UserName", Encrypt(user.UserName));  
          insertSQL.Parameters.AddWithValue("@Password", Encrypt(user.Password));  
          insertSQL.Parameters.AddWithValue("@Computer_Name", user.Computer_Name);  
          insertSQL.Parameters.AddWithValue("@IP_Address", user.IP_Address);  
          insertSQL.Parameters.AddWithValue("@CreatedBy", user.CreatedBy);  
          insertSQL.Parameters.AddWithValue("@CreatedDate", user.CreatedDate);  
          insertSQL.Parameters.AddWithValue("@IsActive", user.IsActive);  
          insertSQL.Parameters.AddWithValue("@Function", user.Function);  
          insertSQL.Parameters.AddWithValue("@Department", user.Department);  
          try  
          {  
              insertSQL.ExecuteNonQuery();  
              dbConnection.Close();  
          }  
          catch (Exception ex)  
          {  
              throw new Exception(ex.Message);  
          }  
      }  
  </code></pre>
  
  <p>Is it a bad idea instead of use Entity Framework or another one?</p>