.mdf
is a SQL Server data file, therefore you need to use the SQL Server client library, e.g. SqlConnection
, SqlCommand
and SqlDataAdapter
.
What you're using now (MySqlConnection
, MySqlCommand
, MySqlDataAdapter
) is for MySQL and won't work on a (Microsoft) SQL Server data file.