Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to pass radio button value to filter data

I have a stored procedure in SQL server to display some data in vb.net application. can I just edit my procedure? how to pass radio button value to display data based on selected radio button without changing VB code and without add new parameter in SQL, is it possible to do? these are my parameters.

ALTER PROCEDURE [dbo].[LMS_Report]      
 @deptID varchar(10),     
 @month int,      
 @year int,      
 @startIndex int,      
 @pageSize int,      
 @generateData int, 
 @totalRecords int OUTPUT  

sorry this is the first time I use vb.net

like image 477
Dhia_f Avatar asked Jun 08 '16 07:06

Dhia_f


People also ask

Does radio button have checked value?

If a radio button is checked, its checked property is true .

What is the use of value in radio button?

Value. The value attribute is a string containing the radio button's value. The value is never shown to the user by their user agent. Instead, it's used to identify which radio button in a group is selected.


1 Answers

Please follow the steps

1)Get the value of radio button while clicking it and stored it in variable.

2)After that you can pass a values to stored procedure while execute a sqlcommand.

for example

1)value for radio button is 'red' this value is stored in the string "RadioButtonValue".

2)pass this RadioButtonValue to the SQL's stored procedure by using cmd.

cmd.Parameters.AddWithValue("@RadioButtonValue",RadioButtonValue).

@RadioButtonValue - variable declared in stored procedures.

else refer the following link

http://www.aspsnippets.com/Articles/Pass-Table-Valued-Parameters-to-Stored-Procedure-from-Code-Behind-using-ADONet-C-and-VBNet.aspx

like image 140
Vivek guptha Avatar answered Oct 25 '22 17:10

Vivek guptha