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


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

Repeating Code with different variables

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :Sql Server
 

Hello,

 I am looking at ways to reduce this repititous code to a simple join or something similiar. Here is the context: We evaluate based upon different codes if a person has any remaining elgibility for say an insurance policy. If the have XYZ it may be good for 36 months. If the have YYZ (Hat Tip Rush) then it might be good for 48 months etc. So we join to a control table that has the codes and their terms. As each row is "processed" we return a Y or N to see if their time is up.

SELECT dfm.TypeofSub,
   CASE
     --Start with our unlimited subscriptions
     WHEN dfm.TypeofSub IN('FIR' ,'FNS') THEN 'Y'
		
     --D Policy Codes
     WHEN dfm.TypeofSub IN ('D25' ,'D38', 'D23', 'D59')
         

View Complete Post


More Related Resource Links

InfoPath repeating table Copy values from above row without Code

  
Hi, I have situation, where I want to copy the values from the above row to the newly created row in a Repeating table. Ex. I have a repeating table with 3 columns ID-Name-FileName. When I enter a data like 1-Customer1-File1.zip and hit "Insert new row", the new row should automatically populate the values of the above row. How can I do it without .Net code. Regards,

How can i safe value of variables in javascript code in PostBack event?

  

Hi Experts.

I need to define some Boolean variables in my javascript code and use them  when  the any onfocusout methods of controls  is fired. Like this:

<script>

            Var is_ValidateTextBox1 = false;

            Var is_ValidateTextBox2 = false;

            Var is_ValidateTextBox3 = false;

Function focusout_TextBox1()

{ValidateTextBox1 = true; }

</script>

When onfocusout of TextBox1 is fire, I want to set  " is_ValidationTextBox1=true;".  But when the post back is fired from the form, the variable reset to false because the line of defining the "Var is_ValidateTextBox1 = false;" is run again in post back!

Now how can I to solve this problem? How can i safe value of variables in javascript code in PostBack event?

With Regards. Mojtaba


code behind - variables and gridview-selected data

  

Hello,

I'm a newbie using VWD 2010 Express, asp.net 4.0.  

I'm also learning VB and C#.  I'm pretty lost, so please direct me. 

I'm trying to understand the code-behind behind gridview select/edit buttons.  I'm not sure whether I need to look for asp.net or VB/C# tutorials. 

   protected void ds_Selecting(object sender,SqlDataSourceSelectingEventArgs e)

Using above example, 
1. How do I access the user-selected row data from the gridview in the code-behind? 
2. What is 'sender' and 'e'? 

If there's a tutorial that explains these, please direct me.

Thank you!



Get list of package variables in SSIS code

  

Hi all,

i need to get list of package variable names during execution of a custom control flow task.

Best regards Crom


Creating Variables in "Parent" from Custom Activities in Code

  

Hi,
Using Workflow 4, I've created a series of custom activities (e.g. Create Email, Upload Email To Document Management System etc.) that need to pass data between each other during execution within a "parent" workflow.. I've read that the recommended method to do this is by using variables declared at the correct scope.  This is easy to do in the designer, so in a standard flow diagram or sequence I create my variables manually, then drop in my custom activities as "children" and assign variables to their InArguments/OutArguments as appropriate.

Unfortunately, this is VERY manual and I'd like to do it in code if possible.   I know that I can create an OutArgument to pass the value back to the parent workflow.. but I need to dynamically create the workflow variable to store that value in as well.. I've read in other posts about people wanting to do similar things..

e.g. http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/4958777a-77c3-448b-aac5-6933eaf726f5

..some of them have tried using the NativeActivityContext.Property (doesn't work directly between two "siblings", they have to be put in a custom container that sets the needed values on its own context p

How do I Access Variables Between Custom Activities From Code?

  

Basically, I have custom activity and I have a variable in it that I would like to access in another custom actvity. It it possible to do this without writting the acutal workflow from code and still use the designer? The best way to describe it would be that I want to declare a global variable from within an activity that would be available to any other activity.

This is an example of what I am trying to:

public class activity1 : NativeActivity
  {

    protected override void Execute(NativeActivityContext context)
    {
      string text = "Sent between activities!";
      context.Properties.Add("globalText",text);
    }
  }

And here is the activity in which I would like to get the contents of the property:

 public class activity2 : NativeActivity
  {
    
    protected override void Execute(NativeActivityContext context)
    {
      string text = "";
      text = Convert.ToString(context.Properties.Find("globalText"));
      
      Console.Write(text);
    }
  }

Stepping through the code shows that the "context" object has zero properties once I enter the second activity. According to different sources this should be working because the context object should still contain my property correct?


Sorting Repeating Tables in Order Forms with Code in InfoPath 2010

  
Learn to add managed code to sort the table in an InfoPath browser form and then publish it back to SharePoint Server 2010 as a sandboxed solution.

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

  
When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Free Code Snippets - ASP.NET

  
You Can Find Useful ASP.NET Related Posts on the above link.

Free Code Snippets - C#

  
Free C# Code Snippets

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

call JavaScript - jQuery code from ASP.NET Server-Side

  
jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side

Microsoft StyleCop: Source Code Analyzer for C#

  
StyleCop is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while StyleCop analyzes the source code directly. For this reason, FxCop focuses more on the design of the code, while StyleCop focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.

Code spelling checker extension for visual studio 2010

  
Building a spelling checker for source code as an extension for visual studio 2010.

C# and XML Source Code Documentation

  
Through many years of enterprise level software development and consulting, I became critically aware of the importance of good source code documentation, and several years ago when I began working with the first release of Visual Studio .NET beta 1 and found C# provided built-in support for inline XML code documentation, I was thrilled.

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.

Bar Code Scanners with the .NET Compact Framework

  
Summary: Learn how to make your applications use bar code scanners in a generic way-ndependent of the specific bar code scanners that are used on different devices. Using the design patterns Façade and Factory, the implementation not only supports multiple bar code scanners, but it also makes it easy to add support for other bar code scanners. After a brief discussion about bar code scanners and the bar code scanner pattern, a download code sample, written in C#, demonstrates the use of the pattern and technologies.
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