I'm trying to create a DSN on an Azure hosted environment using the following code:
public static bool AddSystemDsn(string server, string database)
{
return SQLConfigDataSource((IntPtr)0,
4, //4 = ODBC_ADD_SYS_DSN
"SQL Server\0",
$"SERVER={server}\0DSN={database}\0DATABASE=
{database}\0TRUSTED_CONNECTION=Yes\0ANSINPW=NO");
}
It's returning False, but I'm not sure why. I wonder if there better code I should be using to make a DSN on an Azure environment?