Click here to Skip to main content
15,115,119 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to pass parameters from the C# application to the Datasourec.I have my stored procedure in My Server.Then i used a datasource and used the stored procedure in the datasource.
My Procedure is:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

ALTER PROCEDURE [dbo].[RecordManagement_getcollegeid]
@College nvarchar(max)
AS
Select College_ID
From College
WHERE College_Name = @College

In my application i want to pass a value from the dropdownlist.
Application Code:
SqlDataSource_GetCollegeID.SelectParameters["College"].DefaultValue = ddlistschools.SelectedValue;

I should also be able to stored the value of selected College ID into a variable.

Thanks
Posted
Comments
[no name] 7-Aug-12 20:26pm
   
You pass it as a parameter in your SqlCommand object
barneyman 7-Aug-12 22:23pm
   
Putting your title into google yields +174K results - I can only assume that none of those were appropriate, so please 'Improve Question' to help us understand your actual problem
   
You want to pass the parameter from any control?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900