How To Pass A List Of Values To Compare In A SQL Function In SQL Server 2008?

Feb 18, 2010

I have an SQL Function with the following SQL within:

SELECT StockID FROM (SELECT DISTINCT StockID,
ROW_NUMBER() OVER(ORDER BY DateAdded DESC) AS RowNum
FROM Stock
WHERE CategoryCode LIKE @CategoryID) AS Info
WHERE RowNum BETWEEN @startRowIndex AND (@startRowIndex + @maximumRows) - 1

I have a Parameter @CategoryID - however I need to take in a category ID such as "BA" and translated this to a list of Category IDs such as "IE","EG" etc so my WHERE clause looks like:

WHERE (CategoryCode LIKE 'IE' OR CategoryCode LIKE 'EG') AS Info

I have a Lookup Table which contains the "BA" code and then all the real category codes this means such as "IE" and "EG".How do I have the CategoryID expand to multiple "OR" statements in my SQL Function?

At the moment the query as shown can cope with one CategoryID such as "IE", this is done as I want a category page such as category.aspx where a parameter "BA" is passed such as category.aspx?category=BA and this page will list all items with the category codes "EG" and "IE".

The reason I need this is there is a "parent" category code which has multiple "children" category codes which are different to the parent code. I am using ASP.NET and .NET 3.5 on the front-end if this helps.

View 2 Replies


Similar Messages:

Visual Studio 2008 - How To Compare Radio Button Values With Textbox Values ?

Dec 22, 2010

i have four radio buttons and one text box..i have to check the selected radio button value equals to the textbox value..

View 3 Replies

SQL Server :: How To Compare Two Nvarchar Datatype Values

Dec 1, 2010

In one of my stored procedure I have to compare two nvarchar datatype values.The values containing both numerical and characters.Which function should I write? And one more problem i.e if a number containing zeros in starting ,I should also match including zeros.But not omit zeros.

View 3 Replies

How To Pass JavaScript Function As A Parameter In The Route Values Of Ajax Actionlink

Apr 20, 2010

I need to pass javascript function as a parameter value to the ajax actionlink in asp.net mvc app. how can we achieve this?

View 1 Replies

How To Pass List Of Values To Silverlight

Sep 13, 2010

I want to pass the data from asp.net to silverlight.I tried for jquery to pass data from asp.net to silverlight.but it not working.

View 2 Replies

Data Controls :: Pass Multiple Eval Values To JavaScript Function Inside GridView

May 7, 2015

I want to pass hidden variable to javascript from href. Below is the code used

<input runat="server" id="hidOrganizationId" type="hidden" value="" />
<ul class="gloMenu">
<li id="liOrg" runat="server">
<a href="javascript: DataEncryption('../Admin/DetailPage.aspx?OrganizationId=' + hidOrganizationId)">
<b>Ordering Facility</b>
</a>
</li>

View 1 Replies

Data Controls :: How To Pass List Of Values From One To Another View In MVC Mobile App

Jan 10, 2013

I have 2 views(2 view pages) in first view page I will display some names in this page i will have add button after clicking on add button it will redirect to another page (2nd view page) in this i will display multi selected list or listview then i will select multiple items from multi selected list now this selected items has to bind with first view names and display updated list in 1st page?

My question is this selected items in 2nd view page has to bind with 1st view page and display how to do this using mvc razor for mobile application? 

View 1 Replies

SQL Server :: Pass Value Stored In Database As Arguments To A Function?

Feb 26, 2011

is it possible to pass value stored in database as arguments to a function...

View 4 Replies

C# - Pass Model Values As Javascript Function Parameters From Inside Mvc Html Helper Such A Html.Radio?

Jul 20, 2010

I think I need to drop in some escape characters, but I'm not quite sure where. Here is the javascript function I'm attempting to call:

function setData(associateValue, reviewDateValue) {
var associate = document.getElementById("Associate");
var reviewDate = document.getElementById("ReviewDate");
associate.value = associateValue;
reviewDate.value = reviewDateValue;
}

Here is the asp .net mvc line where I'm attempting to create a Radio button with a click event that calls the above function and passes data from the model as javascript parameter values.

<%= Html.RadioButton("Selected", item.Selected, new { onClick="setData('<%=item.Associate%>','<%=item.ReviewDate%>' )" } )%>

The above throws a bunch of compile issues and doesn't work. A call such as the following does call the javascript, but doesn't get the data from the model.

<%= Html.RadioButton("Selected", item.Selected, new { onClick="setData('item.Associate','item.ReviewDate' )" } )%>
<%= Html.RadioButton("Selected", item.Selected, new { onClick="setData('item.Associate','item.ReviewDate' )" } )%>
<% String functionCall = String.Format("setData('{0}','{1}')", Html.Encode(item.Associate), Html.Encode(item.ReviewDate )) ; %>
<%= Html.RadioButton("Selected", item.Selected, new { onClick=functionCall } )%>

View 2 Replies

SQL Server :: How To Combine Multiple Rows Into A Comma-delimited List In Sql Server In Build Function

Jan 10, 2011

How can I combine multiple rows into a comma-delimited list in sql server in build function?? in HCL

examples :

X
---
12
15
18
20

Output : 12, 15, 18, 20

with in build function of sql server.

View 6 Replies

MVC :: How To Compare The Entered Login And Password Values With Registered Values

Jan 29, 2010

I am working on asp.net mvc using linq to sql. I have to login my application only if the user registered (in register view page).I need to know how to compare the entered login and password values with registered values

View 3 Replies

SQL Server :: How To Get Record Creation Date And How To Compare Date Time Values

Aug 16, 2010

How to get the date at which a record is created in SQL?..i.e, if i add a record to a database table db1 at 8/10/2010 11:30, I want to get the datetime, i.e 8/10/2010 11:30..;.Also let me know how to compare datetime values..

if(8/10/2010 11:30 >8/10/2010 10:30) will work or not?

View 2 Replies

C# - Pass Values To A View In Sql Server

Sep 1, 2010

I have created a view called business this runs sucessfully ,but the problem is how will i use dynamic values in place of 12.925432,77.5940171 ,I want to pass parameter in sql query from c# code behind.

create view [dbo].[business] as
SELECT Id,
Name1,
ZipCode,
StreetName,
StreetNumber,

[Code]...

View 1 Replies

SQL Server :: Pass List To Stored Procedure?

Oct 1, 2010

I'm looking to pass a list into a stored procedure, stored as List<myClass>. I've passed a table in before but I'm not sure how to pass a list.

View 1 Replies

VS 2008 - Calling A Server Side Function From Javascript Without Using PageMethods?

Sep 17, 2010

i have used PageMethods to access the server side functions in javascript , but now my problem is that with pagemethods your controls will not go throught the full page lifecyle and these leads me to have "Object not set for an instance of an object" error. Now can someone come with a differnt approach without using pagemethods. What i want is to call a server side function , i dont want to pass any parameters to it

View 5 Replies

Web Forms :: Server Side Function For Keypress Event On List Box?

Feb 15, 2010

I have a list box as given below:

<asp:ListBox
ID="TotalList"
runat="server"
Width="150"
Height="300"
SelectionMode="Multiple"
onselectedindexchanged="TotalList_SelectedIndexChanged"
></asp:ListBox>

and i want to delete the selected items on pressing delete key.

How can i do it from the server side?

View 4 Replies

Data Controls :: Pass Generic List As A Message From Server To Client

Sep 9, 2013

im just testing out signalr and i am having too much fun and got a little bit far from my usual skill now my question is can i pass a list to the client here is my code actually i learned this from you mr aspsinnipets

Public Sub Send(message As String, id As String)
Dim tomessage = OnlineUser.userObj.Where(Function(users) users.userId = id).[Select](Function(users) users.connectionId).SingleOrDefault()
Dim customers As New List(Of locationslist)
customers.Add(New locationslist)
customers((customers.Count - 1)).CITE_NR = message

[code]....

View 1 Replies

SQL Server :: How To Sum Each Column Values In 2008

Oct 6, 2010

my requirement is to sum the values in each columns in table and displays in total.

I used stored procedure to get 5 rows with values, but i need to total value for each column in bottom row. Like

[code]....

I need to get the total for each column in footer in sql server.

View 6 Replies

SQL Server :: How To Pass Listbox Selected Values To Sqlserver 2005 Stored Procedure

Dec 30, 2010

In my application I have 7 listboxes.Each list box has morethan 100 listitems.

the best way to pass the selected listitem values(including text values also) to stored procedure in sql server 2005.

View 1 Replies

DataSource Controls :: Inserting Date Values Into Sql Server 2008?

May 28, 2010

I have 3 dropdownlist with day,month(e.g Jan, Feb...) and year value. However I am getting an error from my code when trying to insert the concantenated values into a date field in sql server 2008.

My code:

[Code]....

View 9 Replies

JQuery :: How To Compare To Checkbox List And Show Selected In First Checkbox List

Nov 25, 2010

how to compare to checkbox list and show selected in first checkbox list

[Code]....

View 7 Replies

C# - How To Pass A Value From Server Side Page To Client Side Function

Jul 30, 2010

In my application I need to pass a string value from the server side(.aspx.cs) to a function in the client side (.aspx) page.

View 4 Replies

JQuery :: Compare Two Textbox Values

Feb 4, 2011

I need to compare two textbox values using jquery. The fields are Password and ConfirmPassword. How is this done.

View 4 Replies

Web Forms :: Can't Compare Data Of One Dropdown List With Another DDL

Apr 22, 2010

I have a web form where there are couple of DDL's; DDL1 and DDL2 respectively. I want the DDL2 to be populated based on the selection made in DDL1. From the DDL1, I just want to extract the first three digits of the value selected in DDL1 and use it in the WHERE clause of SQL query which is used to generate DDL2.

My prob is that I am not able to extract the first three digits out of DDL1 and use it in the WHERE clause of DDL2. I have pasted all my code below:

Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ddl1Value As String = DropDownList1.SelectedValue
ddl1Value = (ddl1Value.Substring(0, 3))
SqlDataSource3.SelectParameters(0).DefaultValue = ddl1Value
SqlDataSource3.DataBind()
End Sub

Code for DDL2:

<asp:DropDownList ID="DropDownList2" runat="server" CssClass="style29"
DataSourceID="SqlDataSource3" DataTextField="IXC_Vendor_Name"
AutoPostBack="True" AppendDataBoundItems="true"
DataValueField="IXC_Vendor_Name" Height="24px" Width="338px"
onselectedindexchanged="DropDownList10_SelectedIndexChanged">
<asp:ListItem Selected = "True" Text = " " Value = " " ></asp:ListItem>
</asp:DropDownList>.......

View 8 Replies

List And Contains Scenario - Compare Get Excluded And Included Using 2.0

Jul 10, 2010

I have two List's that contain a object of Tag like List<Tag> i need to find excluded and included to do an update operation how do find the difference in them both since they contain a Tag object. Can you use Contains function with a Tag object inside the list.

[Code]....

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved