.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

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

Posted By:      Posted Date: October 23, 2010    Points: 0   Category :.NET Framework


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)

View Complete Post

More Related Resource Links

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.



Ajax Accordion to load data from client click event


I have a Ajax Accordion control on my page with treeview in Content Template. As the treeview for each pane are big. I am wondering whether I can load the treeview from codebehind only after the pane is selected. I can reuse the code from ItemDataBound of Accordion control.

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

insert result of stored procedure in new table

hi how can i insert the result of stored procedure in the new table. Best Regards. Morteza

e.Result when data source was shaped? - linqdatasource selected event - LinqDataSourceStatusEventArg



How do I handle using e.Result when my datasource was shaped (select new{})? example aspx markup below:

<asp:LinqDataSource ID="ldsMain" runat="server" 
                    Disposition.Substring(0, 2) as Status)"
        onselecting="ldsMain_Selecting" onselected="ldsMain_Selected">    

1) since I shaped, it's an anonymous type right? so what do I cast e.Result to in order to be able to get at the data? 

2) I am thinking of using the selected event to handle some conditional page setup based on whether or not any results were actually found from the main query (the one that is used to bind data to a gridView via this linqdatasource control)... so I need to check for count > 0 and if it is, I need to fill a few dropdown controls based on a few new queries that will essentially be some select dis

JDBC - calling stored procedure always returns 1 result set


I am running the following against Northwind on Sql Server 2005. It always returns a result set of 1 row regardless of the parameters passed:

Connection conn;
// not showing conn creation

CallableStatement callStmt = conn.prepareCall("{ call [Sales by Year] (?,?) });
callStmt.setDate(1, new Date (long_Jan_1_1996));
callStmt.setDate(2, new Date (long_Jan_1_1997));
ResultSet rs = callStmt.executeQuery();

Why do I only get 1 row of results back?

thanks - dave

Very funny video - What's your Metaphor?

my stored procedure not give me result as per input given by me


ALTER Proc [dbo].[Usp_CheckUserLogin]
    @Username varchar(20),
    @Password varchar(20)

    Declare @RowCount int
    Declare @RowCount1 int
    set @RowCount = (select distinct UsrId from UserMast where username=@username COLLATE SQL_Latin1_General_Cp1_CS_AS )    
    set @RowCount1=(select distinct UsrId from UserMast where [password]=@password  COLLATE SQL_Latin1_General_Cp1_CS_AS)    
    if(@RowCount > '0' and @RowCount1 > '0')
        if (@RowCount=@RowCount1)
--        select U.UsrId,U.FirstName,U.LastName,U.Email,U.companyId,U.role,R.RoleName from UserMast U join rolemast R on U.Role=R.RoleId
--        where usrid=@RowCount
        select 'success'
     if(@RowCount > '0' and @RowCount1 = '0')

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?

Problems capturing a Click event from a button inside an asp:table


Hi, I am developing a web site to display some data that is inside a database.

To do this I've created an ASPX web page that opens a connection to a database and retrieves the desired data. After that it populates an asp:table object dynamically.

The problem is that some of the fields that are retrieved from the database are too large to be displayed on the web page, so I decided to make a popup that would be able to display just the desired field.

To do this I've added a button to the asp:table so that when the user clicks it the popup would appear with the contents of the field. However what is happening is that when the user clicks on the button, the page just gets reloaded and the Click event handler is never called.

Below is the code in which I add the button to a TableCell, and the TableCell to the TableRow collection:

// Coluna Mensagem Formatada.
celula = new TableCell();
celula.HorizontalAlign = HorizontalAlign.Center;
Button button = new Button();
button.Text = "...";
button.Click += popupHandler;


Please note that the popupHandler is a delegate to the function below. I am using it as a the Click event handler for testing purposes.

protected void abrirPopup(object sender, Even

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

how to add multiple rows in a data table against a button click event


how to add multiple rows in a data table against a button click event, and then show it in a gridview

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

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