.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Variables with Expression & Config

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Sql Server
 

I am generating the Output-Path for FlatFiles dynamically.

I require a file name of the form YYMMDD_name.txt.
For testing purposes I optionally generate the alternative version TEST_name.txt.
I can change the setting from Test to YYMMDD(Release) using a boolean in a config file.

This works pefectly using Expressions from within Visual Studio.

I have two config files, one for TEST and one for YYMMDD.
dtexec /File Package.dtsx /Conf TEST.dtsConfig
dtexec /File Package.dtsx /Conf YYMMDD.dtsConfig

I am now executing the YYMMDD version from command line (Config Value Test=0).
I then get some files of the form TEST_name.txt and some with YYMMDD_name.txt.

I believe the config is not loaded properly until the process has nearly completed.
Out of 20 files a maximum of 5 were generated correctly, mostly 0-3.

Does this ring a bell? I am rather confused and have no idea what to do.




View Complete Post


More Related Resource Links

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

  
.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET AJAX
.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Temporary tables in SQL Server vs. table variables

  
When writing T-SQL code, you often need a table in which to store data temporarily when it comes time to execute that code. You have four table options: normal tables, local temporary tables, global temporary tables and table variables. I'll discuss the differences between using temporary tables in SQL Server versus table variables.

Session and Application Variables

  

I have a web application in which i need to logout the user if he clicks the logout button or even if he closes his browser window. On Logout button click, i am doing session.Abandon(), but how to go about his browser window close.

Can anybody help with a code sample.


reading values from config files in NUnit tests

  

One of my NUnit tests has to read in some values from config files.  In my main application this process works perfectly well, however when I run the unit test, the code that reads in the values from the config files doesnt read anything in.  Ive tried putting app.config in my unit test project (I even tried web.config) but nothing seems to work.  Are there any special steps involved when reading from config files in an nunit test ?


NUnit and config files

  

Ive created an NUnit test project in my solution and have added 3 tests.  They all fail with the same error


Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
  ----> System.NullReferenceException : Object reference not set to an instance of an object.

Systems.Code.Test.TransactionTest.CreateDataContext_ConnectionString_ReturnsDataContextObject:

SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.

  ----> System.NullReferenceException : Object reference not set to an instance of an object.


heres the test method


[Test]
        public void CreateDataContext_ConnectionString_ReturnsDataCon

Modifying connection String in Web config using Install Wizard

  

Hey,

Im trying to create a Web Deployment Project, the built in setup and deployment is very good in Visual Studio, i need to able to add an additional step in the setup to change the connection string in the Web config file. Ive seen a lot of articles on how to do this and in particular this http://weblogs.asp.net/scottgu/archive/2007/06/15/tip-trick-creating-packaged-asp-net-setup-programs-with-vs-2005.aspx#7162670 I am however stuck on the final part of this tutorial, im using the code Scott provided but have two errors,  heres part of my code where the errors are



using System;
using System.Configuration;
using System.Configuration.Install;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.DirectoryServices;

 void ConfigureDatabase(string targetSite, string targetVDir, string connectionString)
        {
            // Retrieve "Friendly Site Name" from IIS for TargetSite
            DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/" + targetSit

Web deployment project - web.config section replacement does not add remove tag

  

I have a web application that is actually installed as a component of a third party site.  In some configurations, I need to remove certain connection strings and re-add them.  I'm replacing this web.config section with a xml file that includes the following:

<connectionStrings>
      <remove name="MyOverridenConnection"/>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"
           providerName="System.Data.SqlClient"/>
    </connectionStrings>

For some reason the remove tag is left out during the substitution and I end up with the following in the installed config:

<connectionStrings>
      <add connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDb;Data Source=MyServer" name="MyOverridenConnection"
           providerName="System.Data.SqlClient"/>
    </connectionStrings>

Is there any way to issue removes in replaced sec

[How??] Lamda expression with ByRef parameter

  

How to write lamda expression with ByRef/ref parameter in c# ??

The code below causing syntax error:

item.OnAction = (p1, p2, ref p3) => {
   .....
   .....
   return true;
};


item.OnAction = (p1, p2, & p3) => {
   .....
   .....
   return true;
};



Can IronPython use dynamic variables?

  

I am building a small application that can

1. Dynamically load 2 text boxes on a web form

2. Build a logic on those textboxes in IronPython to sum them and return the result.

3. I have already built a IPY script that does some opearions on a static text boxes. How to build a script on the dynamic textboxes?


Express Yourself: Encoding Videos Using Microsoft Expression Encoder 3 SDK

  

Video on the Web involves huge amounts of data. Learn the best way to manage and move that data with the help of Microsoft Expression Encoder 3.

Adam Miller

MSDN Magazine June 2010


Security Briefs: Regular Expression Denial of Service Attacks and Defenses

  

Microsoft security expert Bryan Sullivan believes denial-of-service blackmail attacks will become more common as privilege escalation attacks become more difficult to execute. He demonstrates how to protect your apps against regular expression DoS threats.

Bryan Sullivan

MSDN Magazine May 2010


Windows With C++: X64 Debugging With Pseudo Variables And Format Specifiers

  

This month we explain how pseudo variables and format specifiers provide a wealth of information for use in debugging.

Kenny Kerr

MSDN Magazine December 2008


Silverlight: Create Animations with XAML and Expression Blend

  

In this excerpt from his upcoming book, Laurence Moroney explains the basics of Silverlight animation and the animation tools available in Expression Blend.

Lawrence Moroney

MSDN Magazine August 2008


Silverlight: Create a Custom Expression Encoder Publishing Plug-In

  

Laurence Moroney demonstrates how to employ the Expression Encoder plug-in APIs by building and debugging a simple FTP upload plug-in.

Laurence Moroney

MSDN Magazine February 2008


The ASP Column: What's in ASP.NET Config Files?

  

Even though you've been using ASP. NET for a while, how much do you really know about ASP. NET configuration files? While you've probably touched the Web. config file from time to time, there are some nuances involved in configuring ASP.

George Shepherd

MSDN Magazine September 2004


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend