Click here to Skip to main content
15,885,278 members
Articles / Desktop Programming / Windows Forms

UDL.Net, A ConnectionString Editor Built from Scratch

Rate me:
Please Sign up or sign in to vote.
4.80/5 (23 votes)
24 Feb 2010CPOL5 min read 50.1K   2.8K   54  
UDL.Net is a ConnectionString editor built from scratch, modeled after the Universal Data Link (UDL) and the Visual Studio DataConnectionDialog.
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using UDL;

namespace UDL.Firebird
{
    internal class FirebirdStringBuilder: UDLStringBuilder
    {
        public FirebirdStringBuilder()
        {
            Dialect = 3;
            Port = 3050;
            Charset = "NONE";
            PacketSize = 8192;
            ConnectionLifetime = 0;
            ConnectionTimeout = 15;
            MinPoolSize = 0;
            MaxPoolSize = 100;
            Pooling = true;
            FetchSize = 200;
            ServerType = 0;
            RecordsAffected = true;

            RegisterAlias("Server", "Data Source");
        }

        public string Database { get; set; }
        public string User { get; set; }
        public string Password { get; set; }
        [DefaultValue(3)]
        public int Dialect { get; set; }
        [DisplayName("Data Source")]
        public string DataSource { get; set; }
        [DefaultValue(3050)]
        public int Port { get; set; }
        [DefaultValue("NONE")]
        public string Charset { get; set; }
        public string Role { get; set; }
        [DefaultValue(8192),DisplayName("Packet Size")]
        public int PacketSize { get; set; }
        [DefaultValue(0),DisplayName("Connection Lifetime")]
        public int ConnectionLifetime { get; set; }
        [DefaultValue(15), DisplayName("Connection Timeout")]
        public int ConnectionTimeout { get; set; }
        [DefaultValue(0)]
        public int MinPoolSize { get; set; }
        [DefaultValue(100)]
        public int MaxPoolSize { get; set; }
        [DefaultValue(true)]
        public bool Pooling { get; set; }
        [DefaultValue(200),DisplayName("Fetch Size")]
        public int FetchSize { get; set; }
        [DefaultValue(0)]
        public int ServerType { get; set; }
        [DefaultValue(true),DisplayName("Records Affected")]
        public bool RecordsAffected { get; set; }
        [DisplayName("Context Connection")]
        public bool ContextConnection { get; set; }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Other
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions