How can I write an ODBC connection string for Snowflake? I can't seem to figure it out. Below is the sample code I put together in .NET Core:
using System;
using System.Data.Odbc;
namespace SnowflakeTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
string connetionString = null;
OdbcConnection cnn;
connetionString = "Driver={SnowflakeDSIIDriver};Server=xxxxxxx.snowflakecomputing.com;Database=SNOWFLAKE_SAMPLE_DATA;User=xxxxxx;Password=xxxxxxxxx";
cnn = new OdbcConnection(connetionString);
try
{
cnn.Open();
Console.Write("Connection Open ! ");
cnn.Close();
}
catch (Exception ex)
{
Console.Write("Can not open connection ! " + ex.Message);
}
Console.ReadKey();
}
}
}
Here is how you can build an ODBC connection.
foo.udl
. Double Click on itProvider
tab, select `Microsoft OLE DB Provider for ODBC Drivers'Connection
tab, click Use connection string
, then the 'Build` button.Machine Data Source
pick your driver, then fill out the rest (e.g. user & password).