Edward Aymami

Edward Aymami

  • 1.6k
  • 21
  • 2.4k

How to create a connection to SqlServer

Nov 24 2023 4:26 PM

I am Trying to teach myself C#. I'm struggling with getting a connection to SQL server. I have a static class, GetSQLConnectionString that returns a connection string.

When I try to call in in my forms class I get the following:

        private void button1_Click(object sender, EventArgs e)
        {
            string conn = GetSQLConnectionString; (Error displayed here
        }
 

 


Answers (2)