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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Sum Multiple Declared Expressions

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

I have 2 Declared expressions that I need to add together, I know how to do a normal SUM on Select statements however this is a little different, or at least it appears that way to me.

Here are the 2 Declared Statements:

declare @Amount float

select top 1 @Amount = CAST(dbo.Designated_Amount.Amount AS Float)
    FROM  dbo.Designated_Amount INNER JOIN
       dbo.SIMS ON dbo.Designated_Amount.Unit_Code = dbo.SIMS.Unit_Code
    WHERE not exists (Select * From dbo.SIMS Where (dbo.Designated_Amount.Unit_Code = '114') AND dbo.SIMS.Event_Type in ('IR','ME', 

View Complete Post

More Related Resource Links

How to I apply an XAML declared animation to multiple controls dynamically?

Hello, How to I apply an XAML declared animation to multiple controls dynamically? Here is the XAML declared animation: <Window.Resources> <Storyboard x:Key="TextBlock_SB"> <DoubleAnimation Storyboard.TargetName="TextBlock_1" Storyboard.TargetProperty="(TextBlock.Opacity)" From="1.0" To="0.75" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> Here is the code that starts the animation for TextBlock_1: (this.Resources["TextBlock_SB"] as Storyboard).Begin(); I want to apply the same storyboard/animation to TextBlock_2 and TextBlock_3 and perhaps others.  How do I do that without defining more XAML storyboards? Regards, Robert  

1.)Duplicating VB Right() functionality 2.) Seek and replace multiple expressions in a single pass?

Two questions:
1. I want to replicate the functionality of the Right() string function in Regex in order to lop off the first four characters of certain 20 character strings if those leading characters happen to be "K3AH". Right(string,16) would be part of the VB code I'd use to do it but this is what I've come up with using Regex:

Dim re As New Regex("\bK3AH+(?=\d{16})", RegexOptions.Multiline)

Dim source$ = "SRA-7138-29		K3AH1241091742015390	K3AH1241170743153764	6454	dawni001"

source$ = re.Replace(source$, "")
And it seems to work, returning "SRA-7138-29  1241091742015390AH1241170743153764 6454 dawni001"

Is there a better (i.e.,faster, safer, whatever) way to do this?

2. Is it possible, using Regex, to search for multiple (different) expressions and make replacement for all of them while only makin a single pass through a text file?

Multiple Xpath expressions returned in document order

Hi all

I am using XQuery in SQL Server in my project. I need to retrieve multiple elements located in different places in the document and I need the retrieved elements in the document order.
My program should work with any XML file so I do not have a specific structure. It is just a function that gets multiple XPath expressions and return the retrieved elements in the document order.

For example
   <Book ID="1"/>
   <Book ID="2"/>
   <Book ID="3">
       <Chapter ID="1"/>

Assuming the previous xml is stored in column x in Table.

select x.query('
') as result
from Table where ID =1

the previous query will return the elements in the order they have in the query not the order they have in the document, the result is
  <Book ID="2"/>
<Chapter ID="1"/>
<Book ID="1"/>

When retrieving multiple elements using one Xpath expressions, SQL serve

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Linq: how to share parameters between lambda expressions ?

When using Linq to objects, you will quickly feel the need to pass some parameters from a method to another but it's not so easy because each Linq method is not calling the following one. In a Linq sequence, each method is using the result computed by the previous one. So, local contexts are not visible from one method to another.
The compiler is using two technical different ways to let parameters go out of a method.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Various SQL Expressions

A comparison is a Boolean operation that produces a true or a false result, depending on the values on which the comparison is performed. A comparison is performed between two values of the same type; for example, you can compare two numbers, two characters, or the names of two cities. To support comparisons, Transact-SQL provides all necessary operators.

What is Lambda Expressions In LINQ

A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.

All lambda expressions use the lambda operator =>, which is read as "goes to". The left side of the lambda operator specifies the input parameters (if any) and the right side holds the expression or statement block. The lambda expression x => x * x is read "x goes to x times x." This expression can be assigned to a delegate type as follows:

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

GridView Multiple Filter AJAX Control

This AJAX control enables the user to filter data within any column inside a GridView. The user can add multiple filters and can delete existing ones too.

Multiple Column Dropdownlist for the ASP.NET DataGrid

Based on my previous control "Multiple Column DropDownList for ASP.NET", I received many emails asking for the same control to be used in the DataGrid for web applications. Here we go.. This control can be used as the regular MS DropDownList in the DataGrid and also as a regular dropdownlist. It has all the properties, like DataTextField, DataValueField, DataSource, SelectedIndex etc. The download file contains the samples both in VB.NET and C#. In this sample, I have used the Northwind database of SQL Server.

ASP.NET Multiple Selection DropDownList with AJAX HoverMenuExtender

Recently, I was looking for a multiple selection dropdownlist control for my new project. After spending some time researching for it, I decided to put together all my finding in one web user control. This web user control consists of an ASP.NET AJAX HoverMenuExtender, JavaScript, StyleSheet and CheckBoxListExCtrl . The final product will work with or without a MasterPage and you can drag and drop more than one instances of the control on to the page.

jquery autocomplete multiple values


i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?


Gmail style multiple Sign-in type combo...is it possible in asp.net?


I am developing a multi-company application and want my users to give the functionality like the following to switch companies.


Is this possible? then how?

Please help


Multiple Instances of User Control


I have a user control that I place on a page severl times.  When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl.  So I get duplication of an insert that I do.  Is there a way to make sure these events are isolated so this doesn't happen.


>>>How to update multiple rows of gidview by one click



I want to add multiple rows of a gridview if the data for multiple fields are same.

Idea for this is that a user may search a record with some parameter e.g. Sector, plot.

For example 15 records being displayed in gridview.

There should be checkbox before every row and if user wants to update Plot and Flat No that is same for 10 rows out of 15 so he will check the rows and update.

For this a dialog box should appear asking for the parameter i.e. Plot and Flat or something else next time may be it will be City or country. Moreover, there is already an Edit button to update records, when user click it another page open for the record to be updated and whatever he wants to update, it updates.

Hope everone understand the scenario.

I don't want to disturb the already provided Edit functionality and want to provide same record to be updated.

Any idea in this regard would be appreciated.

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