DataSource Controls :: Passing Radiobuttonlist Value To Stored Procedure?

Dec 11, 2010

I have an .ASPX form. All I want to do is simply "Submit" the form field values into a database.

"I have been tasked with re-writing the entire .ASPX form to use "Stored Procedures" instead of a "SQL-String" to insert form values. I think I have most of the form submitting to the database, except the "Radio Buttons" just say "NULL".

I do not know how to progam the Radio Buttons to insert the value (Yes, No, N/A) the user chose into the database. I have GOOGLED but cannot find an answer, and some answers are too complex for my level of understanding at this point.

I need to take the following code and change it so it just calls a Stored Procedure. If you could show me "Stored Procedure" code and how to change my current code to work with the Sproc it would be much appriciated. Here is the code.

I have "11" groups of Radio Buttons I need to change. Here is an example of one of the rows.

<tr>
<td><input type="radio" name="group1" value="yes"></td>
<td><input type="radio" name="group1" value="no"></td>
<td><input type="radio" name="group1" value="N/A"></td>
<td><asp:Label ID="Label22" runat="server" Text="Surfaces exposed to corrosives pH between 5 and 9."></asp:Label></td>
</tr>

Summary: I just want to call a stored procedure and store the value the user chose into my database.

View 5 Replies


Similar Messages:

DataSource Controls :: Passing Query String Value To Stored Procedure

Mar 30, 2010

I'm trying to pass the text value of a text box as a query string value to a stored procedure. I was hoping someone could point me in the right direction. Button Code:

[Code]....

Stored Procedure:

[Code]....

The results page datalist:

[Code]....

Code Behind of results page:

[Code]....

I'm sure i've got this entirely backwards. However if I change the NULL value in the stored procedure with some string value (eg."Donkeys") it pulls all the values that contain "Donkeys" into the datalist on my results page.

View 2 Replies

DataSource Controls :: Using LINQ Passing The Name Of The Stored Procedure Dynamically?

Feb 23, 2010

I have an application where depending on what the user selects run a different stored procedure.

I am using LINQ and am passing the stored procedure name into a sub that will run the stored procedure and return values that I am loading into a DDL.

For example I want to pass the procedure name "GetProducts_Hats" to the sub and not hardcode it.

Protected Sub LoadParamDropDowns(
ByVal SqlObjToExec
As
String )

I am passing the storedprocedure name in parameter SqlObjToExec

so instead of

values = mydb.GetProducts_Hats

I want to code it to be a variable

values = mydb.SqlObjToExec

But the above code does not work.

View 7 Replies

DataSource Controls :: Passing Column Name As Parameter To Stored Procedure?

Feb 12, 2010

ALTER procedure [dbo].[Sample2]
@Col as nvarchar(1000),
@Value as nvarchar(1000)

[code]...

View 5 Replies

DataSource Controls :: Passing Default Parameter To Stored Procedure ?

Feb 13, 2010

I am using DAAB with stored procedures. I use stored procedures more then once if possible. If I add a parameter later in stored procedure, I have to supply value for this in functions where it is even not being used as well, other wise it shows an error that number of parameters are not same. if I add parameter in last of parameter list in stored procedure and set a default value for it and I may have not to provide value for this from functions where I am not using it.

View 1 Replies

DataSource Controls :: How To Convert The Oracle Stored Procedure To Sqlserver 2005 Stored Procedure

Apr 2, 2010

This is surareddy. i nead some small clarification in the "Stored Procedure"

how to convert the oracle Stored Procedure to sqlserver2005/2008 Stored Procedure.

right now i am enhancing the project that project already developed the oracle Stored Procedure. now our company is using sqlserver 2005/2008.

how to convert the Oracle Stored Procedure to sqlserver 2005 Stored Procedure

View 4 Replies

DataSource Controls :: Do Not Use Or Call Any Stored Procedure But It Says "Could Not Find Stored Procedure 'xxxxx'?

Dec 9, 2010

Initially, I have tried to use stored procedure. But I changed my mind and preferred to call sql query in codebase with command text. However, it stills tries to find initially-called stored procedure (which is neither called or exists).I think that it is related caching. But I tried it with different browsers it did not work.What might be the reason?

View 4 Replies

DataSource Controls :: Execute A Stored Procedure Within A Stored Procedure?

Jan 18, 2010

Does anybody if it is possible that a stored procedure returns rows which is the result of the execution of another sp? Something like..

[Code]....

View 11 Replies

DataSource Controls :: How To Call A Stored Procedure In Another Stored Procedure

May 13, 2010

i want to return output parameter from 1 storeprocedure. into another stored procedure.

View 7 Replies

DataSource Controls :: Call One Stored Procedure In Another Procedure For Search?

May 1, 2010

I want to apply other stored procedure select query on result of first stored procedure.

View 1 Replies

DataSource Controls :: Stored Procedures Are Not Showing Up Correctly In The Stored Procedure Drop Down

Apr 27, 2010

I am using Visual Studio 2008 and SQL Server 2008 and have added a SQL datasource to my form.

When I configure the datasource, I choose my connection string which looks like this in my webconfig:

<connectionStrings>

<add
name="PSFSPRD_ConnectionString"
connectionString="Data

The database I am using has a schema called EQB and as such, my stored procedures are named as EQB.usp_SelectFunds, EQB.usp_SelectAccount, etc.

On the select tab of the Configure Data Source screen, I choose to use a stored procedure. The dropdown shows my stored procedures, however, the schema name does not show up in front of the stored procedures in the drop down. I see only usp_SelectFunds, usp_SelectAccount, etc.

I select one of the stored procedures and when I click TEST, I get the message that the stored procedure is not found. If I instead choose to use a SQL statement instead on the configuration screen and enter EXEC EQB.usp_SelectFunds and click TEST, it works fine.

Why are my stored procedures not showing up correctly in the stored procedure drop down and how can I fix this?

View 3 Replies

Forms Data Controls :: Passing Parameters To Stored Procedure When Edit Button Is Clicked In GridView

Oct 27, 2010

I have a grid view that populates and displays data at btn click event from the following sql statement in one of the SP:

SELECT

reg_code, pc_serial, act_code
FROM user_reg
WHERE reg_code=@reg_code

I want to pass parameters to the other Stored procedure when the edit button is clicked in order to update the 2 columns in the specific row at the time. I now how to pass parameters in a regular btn click event or function, but in the case of edit btn in grid view I don't know how to capture data from specific row and then pass it to the SP. Here is Stored Procedure to update the columns (every user always has the same reg code, but may have more than one serial number and activation code, I want to let the user update serial number and then based on the serial number generate new activation code in the SP.):

[Code]....

View 3 Replies

Passing A Parameter To Stored Procedure In C#?

Mar 23, 2011

When I try the following:

[Code]....

I get an error saying No overload for Add method takes 2 arguments. HOw would i pass the PaycheckID in then as a paramter?

View 2 Replies

ADO.NET :: Passing An Array To Stored Procedure?

Mar 21, 2011

I want to send an array of integer to sql server Stroed Procedure as parameter from vb program. How i can do this.

Secondly how I declare an parameter array in stored procedure which accept the array of integer.

View 1 Replies

ADO.NET :: Passing Parameters To A Stored Procedure Using A SqlDataAdapter?

Dec 10, 2010

I am trying to create a method which will access the database via a SqlDataAdapter. I have passed two parameters month and year. When I run it, I get the error "Object reference not set to an instance of an object". I have posted the complete code below. Please take a look..

[Code]....

View 1 Replies

Passing Blank Field Value To Stored Procedure C#?

Feb 21, 2011

I want to return all rows from a SQL Server 2008 database table into a SQL data source if a textBox field is blank. So I made a stored procedure with an if @date IS NULL clause.

Although the stored procedure seems to be working fine in Visual Studio 2008 the actual webpage displays no results.

I am guessing I have to send a DBNull value to the stored proc if textBox.Text == string.Empty. I tried the SqlDataSource1.SelectParameters.Add but it seems that I get a conversion error from DBNull.Value to string.

Is this the source of my problems or am I missing something else? How would I pass DBNull.Value to a stored proc if a textfield is blank?

View 2 Replies

Passing List Of Name / Value Pairs To Stored Procedure?

Aug 10, 2010

I have a name/value pair in a List<T> and needing to find the best way to pass these to a stored procedure.

Id Name
1 abc
2 bbc
3 cnn

What is the best way to accomplish this?

View 3 Replies

DataSource Controls :: To Use Stored Procedure In .net

May 30, 2010

how to use stored procedure in asp.net for for manipulation form sql server (in details).

View 2 Replies

DataSource Controls :: Stored Procedure In .net?

Mar 31, 2010

parameters inside the stored procedure.How to write .

View 6 Replies

SQL Server :: Passing Multivalue Parameter To Stored Procedure

Jul 28, 2010

I want to know, how do i send a multivalue parameter from C# to Stored Procedure which is used in WHERE CLAUSE in IN statement?

for eg:

CREATE PROCEDURE [dbo].[sp_GetPolicyDivOff1]
@Insid varchar(5000)=null
AS
SET NOCOUNT ON

SELECT MST_GroupCompany.GC_Name,MST_DivisionalOffice.DIV_Name FROM MST_DivisionalOffice INNER JOIN MST_GroupCompany ON

MST_DivisionalOffice.DIV_FK_GC_ID=MST_GroupCompany.GC_ID where GC_Name IN(@Insid)

View 10 Replies

SQL Server :: Passing An Array From C# Code-behind To Stored Procedure?

Nov 2, 2010

Via the button1_ click event I retrieve all files in a directory (Example Follows)

[Code]....

I now need to check whether this filename exists as a field in a SQL Server table. For example, if the directory retrieves a file named ExampleFile.txt which does not exist in the (Table = TableFileStore;s Field = FileRetrievals) then I want to insert the filename.

How do I construct a stored procedure to pass the filename(s) into a stored procedure as a parameter? Do I need to also create an array of filenames and pass the array into my stored procedure? Does the stored procedure belong within the foreach loop?

View 3 Replies

SQL Server :: Passing A Variable To A Remote Stored Procedure?

Feb 27, 2011

I have a SQL stored procedure on a SQL server that uses a variable to create a new database. This works in SQL I have a connection string that works I have added a sqldatasource to a webform, and configured the datasource to connect to the remote SQL database and am able to select my stored procedure. I am able to bind the variable to a control in the sqldatasource wizard (often two of the same control appear- if that is significant)

When I test the sqldatasource in the configuration wizard and put in a manual entry, the procedure runs and works

It is on the web page I am having troubles. I want the user to enter a name in a text box, click a button/link, and run the procedure. Ive used buttons and links...but not in the right way I think, becuase when I click them the stored procedure doesnt run.

As mentioned above, I have selected the right control in the sqldatasource wizard. So what do I need to do now?

Is it button click event? If so whats the syntax?

Should I be embedding my textbox in a dataview?

View 4 Replies

Passing Whole Dataset To Stored Procedure In MSSQL 2005?

Oct 5, 2010

How do I pass a dataset object to a stored procedure? The dataset comprises multiple tables and I'll need to be able to access them from within the SQL.

View 3 Replies

SQL Server :: Passing Array Paramaters To Stored Procedure?

Nov 1, 2010

I need to send an array of strings to a stored procedure and then use that array of strings to create a filter of the data returned.for example I need need to send the following array to the strored procedure:

[Code]....

and use that array to run the fillowing sql command:

[Code]....

View 17 Replies

SQL Server :: Stored Procedure Is Not Passing In A Primary Key Into A Foriegn Key In Another Table?

Jul 14, 2010

I am a rookie developer here and I have tried looking around for an answer but I am little confused. I have a stored procedure that calls multiple stored procedures when I go to create a new contact.[Code]....

I though I could use the OUTPUT Command to copy out the NewContactID but I am getting all kinds of syntax errors. I am confused as to what I am missing here.

View 3 Replies







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