© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•11mo ago•
11 replies
[ECH]JamHighlight[100 vouches]

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);
                }

        }
        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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.SqlClient
C#CC# / help
15mo ago
❔ System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Runtime, Version=6.0.0.0
C#CC# / help
3y ago
❔ Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly
C#CC# / help
3y ago
✅ FileNotFoundException: Could not load file or assembly. The system cannot find the file specified.
C#CC# / help
17mo ago