I want to achieve this:
public void SQLInfo(string column)
{
SqlConnection Connect = new SqlConnection(
"Server=server;Database=db;User ID=user;Password=pass;");
Connect.Open();
SqlCommand com = new SqlCommand(
"select distinct [column] from [dbo].[ServerAttributes]");
SqlDataReader reader = com.ExecuteReader();
}
I failed to find documentation on this. Is there any specific method to use a string passed through a parameter within a string? For example, in Powershell you could use the '$' to denote a variable within a string. "This is the $server you're working on."
columncan be provided via user input (and it probably can).