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


Top 5 Contributors of the Month
david stephan
Post New Web Links

Get Values into a variable

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
 
Hello, If using crystal reports i am trying to pass the 'Selected Values' to one of my variables but i am not quite sure how to achieve this so far i was able to map the following DECLARE @SA BIGINT, @EA BIGINT, @SB BIGINT, @EB BIGINT   SET  @SA = {?StartA} SET @EA = {?EndA} SET @SB = {?StartB} SET @EB = {?EndB}   but i want to be able to add another variable that will accept multiple values from the report like account all as int 1111 2222 3333 i want to evaluate those values as the following SET @ALLAccounts = {?Accounts}   and then in my queries do something like Select * from Blah where AccountB in (?Accounts)  but this of course wont work can anyone please help me?   Regards


View Complete Post


More Related Resource Links

How to store and retrieve multiple values in a single session variable .

  

I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.


Comparing Null Values(from variable) in SSIS

  
Hi All I need to create a script that checks to see if a variable value is NULL, if it is then it executes the next SQL Task and if not then the package has finished. I have this in a SQL 2000 DTS package script: Function Main() If isnull(DTSGlobalVariables("NextLoadDate")) Then Main = DTSStepScriptResult_DontExecuteTask Else Main = DTSStepScriptResult_ExecuteTask End if End Function As you can see, all I want to do is check to see if a variable is null then don't execute the next task. But i cannot get it to work in a SQL 2005 SSIS package, so far I have created a script and come up with the following: Public Sub Main() If Dts.Variables("NextLoadDate").Value.ToString <> "" Then Dts.TaskResult = Dts.Results.Success Else Dts.TaskResult = Dts.Results.Failure End If End Sub Any Ideas? Thanks BigGopher

why would some one pick a variable contain XML values instead of CSV values?

  
hi friends, in one of my previouse post i have asked how to save I;M relationships to tables, the i have received two answers: for the many part of I : M relationship: 1. create a varaible of type varchar() that will holds values has csv 2. create an xml varaible   why would some one choose XML type instead of CSV? thanks

How do I get column values in Sharepoint designer so I can use them as a variable in code block?

  
The code below is in my EditForm.aspx and it works but instead of it outputting "This is just a test!" I need get a number that is stored in a column named Phone Number that has 5555555555 stored in it and have the line that says TD2.innerHTML = "This is just a test!"; ouput what ever number is stored in the Phone Number column. Here is the code that is in my EditForm.aspx <script type="text/javascript">function DisplayItemID(){       var TD1 = document.createElement("TD");       TD1.className = "ms-formlabel";       TD1.innerHTML = "<h3 class='ms-standardheader'>Test</h3>";       var TD2 = document.createElement("TD");       TD2.className = "ms-formbody";       TD2.innerHTML = "This is just a test!";       var IdRow = document.createElement("TR");       IdRow.appendChild(TD1);       IdRow.appendChild(TD2);       var ItemBody = GetSelectedElement(document.getElementById("idAttachmentsRow"),"TABLE").getElementsByTagName("TBODY")[0]; 

Multiple Values to the Variable, HOW?

  
Hi All, I'm trying below query which is working fine:- DECLARE @FULLNAME VARCHAR SET @FULLNAME = 'PQR, ABC L.' SELECT ID FROM TABLE-NAME WHERE LAST_NAME = SUBSTRING(@FULLNAME, 1, PATINDEX('%,%', @FULLNAME) -1) AND FIRST_NAME = LTRIM(RTRIM(SUBSTRING(@FULLNAME, PATINDEX('%,%', @FULLNAME)+1 , PATINDEX('% %', @FULLNAME)))) But when I include two values to the same variable something like this:- DECLARE @FULLNAME VARCHAR SET @FULLNAME = 'PQR, ABC L.', 'LMN, XYZ' SELECT ID FROM TABLE-NAME WHERE LAST_NAME IN SUBSTRING(@FULLNAME, 1, PATINDEX('%,%', @FULLNAME) -1) AND FIRST_NAME IN LTRIM(RTRIM(SUBSTRING(@FULLNAME, PATINDEX('%,%', @FULLNAME)+1 , PATINDEX('% %', @FULLNAME)))) It is giving me error as:- "Incorrect syntax near 'SUBSTRING'." This is because my @FULLNAME will be an SSRS report parameter and which is going to be multi-value parameter. Any Help Please? Thanks Regards, Kumar

how to store the values in a object variable (package level scope) in a script component

  
I have declared a variable of object type with package level scope.  I want to assign values to this variable inside a script component.  My object should hold 5 columns in a row.  How to implement this ?

How do i watch variable values during debugging ?

  
Is there a way i can see the value of the variables during debugging ?

Get the values of session variable 'x' through javascript?

  

I need to query for a session variable called 'steps' every 10 seconds from my Webform in ASP.Net using javascript. This session variable holds an integer value.




Local variable scoping in C#

  
In my previous post, Compiler-generated scopes for local variable declarations, I briefly touched on the issue of multiple meanings applied to the same name. In this post, I'll aim to flush out the compiler's rules with regards to binding names in their local scopes.

Compiler-generated scopes for local variable declarations

  
I was tasked with understanding and fixing a bug on error reporting with foreach iteration variables the other day, and it got me thinking about local variable scoping rules in C# in general. First, the bug.

How to Pass Values Between Web Pages ASP.NET

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source page.

How to Pass Values Between ASP.NET Web Pages

  
You can pass information between pages in various ways, some of which depend on how the redirection occurs. The following options are available even if the source page is in a different ASP.NET Web application from the target page, or if the source page is not an ASP.NET Web page:

Use a query string.

Get HTTP POST information from the source page.

The following options are available only when the source and target pages are in the same ASP.NET Web application.

Use session state.

Create public properties in the source page and access the property values in the target page.

Get control information in the target page from controls in the source 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?

 


Retrieving a variable from a previous page

  

Hi,

I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.

A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.

How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?


Thanks.


Embeb a variable number of videos

  

I need to provide some alternate content for my non-Flash users.

I have a directory of video files that is scanned using the DirectoryInfo() function, and I want to use the results to embed all files ending in ".mov" in QuickTime players on a web form.

How would you approach this? Right now I am using the count on the array of videos to determine how many times to repeat the embed code.  But this seems inelegant.

Is there a way to have a single QuickTime player.ascx control that gets duplicated according to the number of videos available for display?


How to take value of bound field of grid in a variable or in a textbox.

  

How to take value of bound field of grid in a variable or in a textbox.

 I m using this code in .aspx page for grid.

<asp:GridView ID="Grd_Mprocess" runat="server" AutoGenerateColumns="False"

                      Width="100%" AllowPaging="True"

                      onpageindexchanging="Grd_Mprocess_PageIndexChanging"

                      AllowSorting="True" PageSize="5"  >

                 <RowStyle CssClass="odd" />

                    <Columns> 

<asp:BoundField HeaderText="DOC_TYPE_PK" DataField="DOC_TYPE_PK"  Visible="true" >

</asp:BoundField>

  <asp:TemplateField HeaderText="DOC TYPE ID" Visible="true">  &nbs

JQGrid Loading deleted values

  

Hi,

This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.


Here is the code:


function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {
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