How to set up .net teradata connection in c#?

前端 未结 4 2440
天命终不由人
天命终不由人 2021-02-14 12:36

I am trying to connect to Teradata with c#. I am using the sample code from this website

using System;
using System.Collections.Generic;
using System.Text;
usin         


        
4条回答
  •  感动是毒
    2021-02-14 13:19

    Copy paste this.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Teradata.Client.Provider;
    
    namespace Teradata.Client.Provider.ConsoleApplication2
    {
        class Program
        {
            static void Main(string[] args)
            {
    
                TdConnection cn = new TdConnection();
                TdConnectionStringBuilder conStrBuilder = new TdConnectionStringBuilder();
    
                conStrBuilder.DataSource = "DSN";
                // conStrBuilder.Database = "optional";
    
                conStrBuilder.UserId = "user"; conStrBuilder.Password = "pass";
                cn.ConnectionString = conStrBuilder.ConnectionString;
    
                cn.Open();
    
                Console.WriteLine("connection successfull");
            }
        }
    }
    

提交回复
热议问题