.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

passing Multivalue or Single value in a dataset Fx

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

Hi all,

I am trying to use 2 prompts in my report from the first prompt (multivalue) I select the column name, and the second Prompt (multivalue)  should show the distinct values for the column selected in the first prompt, I am able to do this by using union all and using a if clause, but then it does not work when I select only one Column name in the FIRST prompt.

The code is like this:


" select " & Parameters!col_name.value & " as col_heading from mytable  " 


"select " & Parameters!col_name.Value(0) & " as col_heading from mytable " &

" union all select " & Parameters!col_name.Value(1) & " as col_heading from mytable " 


Any help on this.


View Complete Post

More Related Resource Links

merging multiple tables in a single dataset to single table


 i have a stored procedure which returns three tables to a dataset ..... now i need to merge all three tables to a single table from d same dataset 

like dataset1 has table1 table2 and table3 .... i want all the three tabels to be merged into dataset1 itself .... instead of three diffrent tables so that i can show all three table data in a single datagrid  as a compact data and combination of 3 tables from d single dataset.....

can some1 help me please.....

Passing 3MB DataSet via WCF - Best Practice


In our application we have several DataSets with about 2-4MB of size.
Each DataSet contains of only one single DataTable.

The data has to come from the server to a client via WCF. Client and server are in the same LAN. What are best practices to pass the data?

The only thing I think I can be sure about is that I should use binary encoding for the binding.

The following questions are still not clear for me:

  1. Which binding should I use - netTCP or WSHttp?
  2. I know that a DataSet produces overhead, but does this really matter in my case?
  3. If the DataSet produces to much overhead, what should I do best to get the data to the client fast?
  4. Should I use streaming or better the standard buffering?
  5. Which timeout and max size settings do I have to take care of (MaxReceiveSize, SendTimeout and so on)?
  6. What do I have forgotten to pass the data quickly?
Thanks for your thoughts about this subject.

Additionally to that: What else do I have to mention if my DataSet becomes about 10MB of size?


Facing problem in Passing Multiple values to a DataSet


Hi all,


I have a report parameter(@rptParameter), which allows only single value.

The Main Data Set query :

Select * From XXXX 

Where Title like @rptParameter+'%'

This is how i'm handling till now.

but now i need to allow users to select multiple values at report param,

and need to generate report based on that.


I'm totally lost, i don't have any idea that hw can i use "like" and "in" at a time in my Data set.


Please help me out.


If you not clear with question, let me know i will give you some example.


Thanks in Advance.


sql passing multiple value in single parameter


Hi all ,

I have a stored procedure with one parameter @reportname where i am suppose to pass report name to diplay data ,but i want this parameter to accept multiple value n.means if i give multiple reportname then it should get insert in my table ..i am writing the script..below..



procedure [dbo].[abc11](@ReportName nvarchar(500

Passing parameter to Subreport dataset query returns no results



I'm using the subreport as a workaround to not being able to join two disparate datasets. The "tickler" file  of keys comes from an Access DB defined as a dataset in my main report. The subreport has a dataset query using parameters from the main report. 

When subreport returns no results, I want to display an error message in the main report and continue to the next row key processing. How do I accomplish that?


Creating Dataset Dynamically in c# and passing to Report Viewer..



 It sounds silly!! but i can't figure out how to get the data to the report viewer from the dataset that i have created in c#. because my dataset is dynamic and the columns would vary every time when i load into the report viewer. i read thru most of the articles but was unable to figure houw to work this out.

the data set for eg i created is:-


private DataSet getDataSet()
   string sql = "";
   OdbcDataAdapter adptr = new OdbcDataAdapter(sql, _connection); 
   DataSet ds = new DataSet();
   return ds;

and from this dataset i have to create the report viewer. this is created in cs page of the aspx page where the report viewer is. also i have a blank report.rdlc. please help me thru this...

thanks in advance..



Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

Introducing ADO.NET and the Typed DataSet

In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

Create and Use a Typed DataSet by Using Visual C# .NET

This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Get Top 1 Record from Dataset

Many of them in need of getting the Top 1 or Top 10 records from a Dataset without going to SQL query. It is possible to do from Code Behind. I have given the code below,
The below code is to get single record from a Dataset. Also I have given for getting 8 records at Green Color.

Returning a DataSet From a Web Services: Step-by-Step

This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.


This Example Shows how to create a webservice which returns a DataSet and a Client Which displays the DataSet in a Grid.

Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Persist large dataset across ASP.NET pages. No database


Can anyone give me suggestions on how to implement the following requirement?

1. A online wizard (step-by step operation) processes user requests across several ASP.NET pages.  The session data is stored in memory until the user submits the request.  Once the request is submitted, a XML file is created and the data are passed to XML.

# Case Study: The parent page has a "select" button.  Click "select" will pop up a child page.  The users can select 1000+ items from a datagrid in the child page.  Once the user clicks "confirm", the selected items in the child page will be populated to the selected item gridveiw in the parent page.  The user can keep selecting more in the child page and the selected items will be appended to the gridview in the parent page.


- What's the best way to extract strings from a text file and convert to a dataset in memory and then present it in a datagrid in UI?

- What's the best way to persist and manipulate a large dataset across pages?  Session? or ViewState? Can it be accomplished by LINQ?

The app doesn't interact with a DB.  Once the request is submitted, it will convert the in memory data to a XML file.  What technology can be used to accomplished this?&nb

Passing values in pages


Hi! Friends..

how to pass the value from one page to another page in asp.net  with out Using State Management Concepts?

Like 1. cookies


        3. QueryStrings

     With out using the above should pass the values...

Why not Dataset use to Saving?


Hie Friends,

I have searched on net and even i worked on 2 huge shipping projects.

Everywhere i found that while binding data to control use dataset but when we save, they recommend use command (use generic collection and create command object with store procedure) why not we use dataset as in .NET 2.0 it is improved lot and data adapter has new feature batchupdatesize.

why we need to create property page which maps to all column in a database.

E.g. if i have employee table with empid and empname in database then i use to create emp.cs with properties of empid and empname and use same properties for saving. If i use these properties for validation in business rule then no problem. But why we use them in saving for creating command object.


DAL Dataset showing all the column


I follow the tutorial and create DAL with Dataset. I created a Table Adapter with many column, but when i Call a simple Get for 2 column only. The system display 2 column and the rest column with empty data.

My question is that will this affect the performance? because i only need 2 column.

example: Table with 40 column define in Dataset in DAL. I have GetMember from Dataset with 40 column, some request only 1 column (with 39 empty), some request 22 column (with 18 empty column). Will this affact the performance?

Should i create a seperate DatasetAllColumn, Dataset1Column, Dataset22Column ?? so system only return exact column i need. and hofully the performance is optimized to it best.

how To Insert the single quotes in sqlcommand in asp.net


Hi all

    i am developed on simple user registeration application in that i gave  address field .when i am trying to enter something like this (1st main,b'lore) but wont take while inserting.

my query is

sqlcommand cmd=new sqlcommand("insert into registeration_form(name,address)values('"+txtname.text+"','"+txt_address+"')",con);

how can i pass the  quotes also to my query please if any one know reply me.


G Dinakaran

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