.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

How to take data from aspx page to stored procedure?

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :Windows Application

Hi all, I have to create an RDLC report in asp.net. For which I am writing a stored procedure using different scalar functions. I have a GUI from which I have to select a criteria and collect data according to that criteria. The GUI is here:


I have implemented all cases like "All Staff", "All services", etc but the problem comes when I have to select specific records from list box and bring data according to that. For example I select specfic Staff records from list and my report should display the records only having that selected records. How can I handle this? I mean when I select some records from listbox, how can I take these records to the where clause of my stored procedure and how to use it there?

I am using SQL SERVER 2008.

Any help would be appreciated.

View Complete Post

More Related Resource Links

Please help URGENT - how to pass XML from aspx page to Stored procedure


Hi all,

I would like to take your help for a small task of mine. I have dataset whose contents have been converted as xml, the contents of which needs to be sent to a stored procedure. How do i go about creating methods in the data layer and the stored procedure.

What should be parameter type in the data layer's method and what should be the parameter type in the stored proc. I dont want to use a varchar at the stored proc level because it is limited to a length of only 8000 characters. Please suggest a solution

I would be glad if someone could post some sample code.

export datatable from .net code page (aspx.cs) to sql stored procedure


Hi experts

Can any body tell can we pass datatable from code page to sql stored procedure. If yes tell me how.


Any sugession acceptable.



Trying to run a stored procedure from vb code with oracle data provider.



Here is my SP:

create or replace
 Open p_getuserssignon_recordset1 for
 SELECT Distinct(Userid), UserPassword, SecurityLevel, ActiveStatus
WHERE substr(UserId,1,2) <> vUid
Order By UserId;

I would like to run this SP from code and fill a gridview with the result. 

I am not sure how to go about this, as I have found several different examples, other than the one I  think I need.

I am using the oracle data provider and I have an input parameter (vUid, which will equal "zz").

First question. When filling a gridview with a result set from a stored procedure should the recordset OUT be defined as a REFCURSOR (like i did above)? 


Do you have example code as to how to execute the SP and fill a gridview?  I keep trying different variations of code i've found on the internet without any success other than getting more confused.

(I am using VS 2005, VB).

Thank you.



Changing aspx page causes session data to be lost...


Strange but true. Any ideas what might be causing this?


Entity Framework 4.0 Dynamic Data - stored procedure


I'm using Dynamic Data and have created a custom List.aspx page.  I simply want to populate the grid with a stored procedure.  I've seen some posts about doing this with a LinqDataSource but not an EntityDataSource.  Does someone have an example or a different way of doing this?  Thanks.

can a Workflow access a stored procedure and pass the parameters from the list data to the stored pr

The reason that I would like to consider this functionailty is because my table architecture is complicated and I do not want to modify my master table to accept all of this data where some of the data should be normalized into sub tables.  Has anyone see evidence of the stored-procedure parm approach?  Is this best accomplished through VS 2010 or can I do it through SPD? Thanks

inserting data after caliculation using stored procedure

hi my requirement is like i want to insert data to table after caliculationliketable name salaryhikecolumns salaryinput,20%hike, 25%hike and 30%hikesalaryinput column details  to be input by the user and hike is to be caliculated and inserted with 20%hike, 25%hike and 30%hike are columns of same table.plz help me.thank you very much.

No Return Type for a Stored Procedure in a Linq to SQL Data Layer

Hello. First, I don't know if this is the right forum section to post this in, but I couldn't fine a more suitable one. Feel free to move this if it's totally worng. I have a weird problem when using LINQ to SQL and Store Procedures with a return value... The problem is that when I drag my SP's onto the "Methods Pane" the property field "Return Type" is set to (None) and greyed out. And here's the most weird thing... I created a test SP yesterday wich returned SCOPE_IDENTITY() and it worked flawlessly. Dragged it onto the "Methods Pane", could play with the return type property (hence it was not greyed out) and everything was working out nice. I used a ISingleResult<T> and could fetch the .ReturnValue... Today I was going to contiune to create the rest of the SP's i needed with a return type but today when I drag my Store Procedures to my Methods Pane, I couldn't access the Return Type property... I even dragged the SAME procedure I used yesterday (wich then worked great) and now I can't get the dbml-layer to notice that there is a return value... I've tried to create new solutions, new Data Layers, used different databases/servers, but still the same problem... Don't really know if it's LINQ or something else that's causing this... This is how part of my SP wich I used yesterday to test looks

How to programmatically POST data to an aspx page?


Hi everyone,

I'm trying to POST data to an aspx page.

I've got a button click event (btnSend_Click) within which I want to programmatically POST data ("key1=value1", "key2=value2") to another aspx page ("ReceivingPage.aspx") on my site.  It would be very easy to do if it were a GET, cos I'd just append the data key/values to a query string of a HyperLink control. But How do I do this as a POST? 

Thanks for the help. 

Correct Way to Insert Data from Text Boxes on ASPX page into SQL Database Using VB


Please help me, I have been trying this for a week now and this is how far I have gotten.


I am new to this, and I am using MS Visual Web Developer Express.


OK - This is what I have come up with, but when I run it I get the following error  (I decided to just try to use a simplified table just to get an understanding of the basic concepts):



Partial Class label_form
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Declaring variables
        Dim username, labelname, ownersname, address1, address2, city, state, zipcode, country, contactnumber, emailaddress, data_source, con, sql_insert

        ' Check if Necessary Text Is Missing ( will do this once I can get it to work with no empty text boxes)

        ' Get Values from TextBoxes
        username = txtUserName.Text
        labelname = txtLabelName.Text
        ownersname = txtOwnersName

How to write Stored Procedure for Insert Data & Execute it in MS SQL?


How to write Stored Procedure for Insert Data & Execute it in MS SQL?

Use a stored procedure to return data for algorithm



I am looking at using the time series algorithm to predict a products future.

However, I seem to have missed the obvious. How do I return a subset of a tables data as the input to the algorithm?

Can I specifiy a SP to use or do I specify the parameters within DMX?



Getting data from a stored procedure instead of a table


Using linq2sql, I've seen examples of using stored procedures for insert, update and delete but how can I use a stored procedure for select?

Thanks, Simon

Getting data from a stored procedure instead of a table


Using linq2sql, I've seen examples of using stored procedures for insert, update and delete but how can I use a stored procedure for select?

Thanks, Simon

SSIS DB2 Stored Procedure as a data source



I have this problem:

In a DTS package I can connect to a DB2 on an AS400 and execute a stored procedure. I can then import this data into a table.


I can't do this in SSIS. DTS uses an ODBC connection. I have tried this with SSIS 2008 r2 – I can use a ado.net connection which picks up the ODBC driver.

I pass in the stored proc as a sql command.

I click preview and all the data is there. I click columns and none are defined.


Has anybody gotten this to work? It seems like a step back to me- DTS did

Capturing data through a stored procedure as a result of a click event (asp.net)



I am having trouble capturing data as a result of a click event. Basically, I don't know what code to put and where for the click event.

I need to record information from a text box, into a table in Microsoft SQL Server. Any help would be great.

My stored procedure is below:

/****** Object:  StoredProcedure [dbo].[SearchConcept_SP]    Script Date: 10/23/2010 12:17:48 ******/
ALTER PROCEDURE [dbo].[SearchConcept_SP]
@Concept_Name nvarchar(50),
@Keywords char(50)

IF EXISTS(SELECT Concept_Name FROM Concept WHERE Concept_Name = @Concept_Name)
PRINT 'This concept already exists'

INSERT INTO Concept VALUES (@Concept_Name, @Keywords)

transfer data from a database to another using a stored procedure


I need to transfer data  from a database to another using a stored procedure in a C# application. I have some tables in the first database and I need to transfer data from them in others tables from the second database, not all columns but few of them.

How should I do that?


Thank you for your time!


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