DataAccessModule.SQLServerConnect.SetupConnectionString C# (CSharp) Method

SetupConnectionString() public method

Set the complete connection string
public SetupConnectionString ( string P_connectStr ) : void
P_connectStr string /// Full connection string to use ///
return void
        public override void SetupConnectionString(string P_connectStr)
        {
            m_connectStr = P_connectStr;
        }

Same methods

SQLServerConnect::SetupConnectionString ( string P_server, string P_database ) : void
SQLServerConnect::SetupConnectionString ( string P_user, string P_password, string P_server, string P_database ) : void

Usage Example

Ejemplo n.º 1
0
    protected void cmdImport_Click(object sender, EventArgs e)
    {
        var connection = new SQLServerConnect();
        //for live db
        //connection.SetupConnectionString("Server=MyPetsFW.db.3554730.hostedresource.com;USER ID=MyPetsFW;Password=DevryWeb460;Database=MyPetsFW;Trusted_Connection=False;");

        //for my local db
        //connection.SetupConnectionString("JON/Chris", "", @"Jon\SQLEXPRESS", "MyPetsFW");

        connection.SetupConnectionString("TestUser", "testuser", @"Jon\SQLEXPRESS", "MyPetsFW");

        var reader = new Reader
        {
            VendorID = 1,
            LogFile = @"C:\WEB460\DataImport\Output\Import09.log",
            DebugLevel = 3
        };

        const string fileName = @"C:\WEB460\DataImport\20090310-Products.txt";

        //string output = !reader.DoImport(fileName, connection) ?
        //            "There was an problem with the import." :
        //            "Import Successful.";
        //Console.WriteLine(output);

        lblError.Text = !reader.DoImport(fileName, connection) ? "There was an problem with the import" : "Import Successful";
    }
All Usage Examples Of DataAccessModule.SQLServerConnect::SetupConnectionString