FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=0.0.0.0, Cult

        public void makenewuser()
        {
            string constring = "Data Source =LAPTOP-3KI3JMHO; Initial Catalog = Stormz; Integrated Security = True";
            using (SqlConnection con = new SqlConnection(constring))
                try
                {
                    con.Open();
                    SqlCommand com = new SqlCommand("INSERT INTO users('" + firstname + "','" + lastname + "','" + email + "','" + password + "','" + country + "', '" + city + "')", con);
                    com.ExecuteNonQuery();
                    con.Close();
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }

        }
This is the method giving the issue. Before I was using System.Data.SqlClient but it gave me an error so I switched to Microsoft.Data.SqlClient now im getting this issue. I downloaded the package and it exist so im not to sure why it keeps throwing an the exception in the title.
Was this page helpful?