is it possible??
-
hi... how to pass muliple option from a drop down to the stored procedure as string and then pass the values to the conditional clause of the procedure. sathy
imsathy wrote:
muliple option from a drop down
A drop down only permits one option to be selected at a time.
imsathy wrote:
to the stored procedure as string
string value = MyDropDownList.SelectedValue;
SqlCommand cmd = new SqlCommand(myConnection, "StoredProc");
cmd.CommandType = CommandType.StoredProcdure;
cmd.Parameters.Add("@paramName", value);
SqlDataReader reader = cmd.ExecuteReader(); // Assumes connection is open.imsathy wrote:
then pass the values to the conditional clause of the procedure
For example:
CREATE PROCEDURE dbo.StoredProc
@paramName varchar(100)
AS
SELECT * FROM SomeTable
WHERE someColumn = @paramName
GODoes this help? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
-
imsathy wrote:
muliple option from a drop down
A drop down only permits one option to be selected at a time.
imsathy wrote:
to the stored procedure as string
string value = MyDropDownList.SelectedValue;
SqlCommand cmd = new SqlCommand(myConnection, "StoredProc");
cmd.CommandType = CommandType.StoredProcdure;
cmd.Parameters.Add("@paramName", value);
SqlDataReader reader = cmd.ExecuteReader(); // Assumes connection is open.imsathy wrote:
then pass the values to the conditional clause of the procedure
For example:
CREATE PROCEDURE dbo.StoredProc
@paramName varchar(100)
AS
SELECT * FROM SomeTable
WHERE someColumn = @paramName
GODoes this help? ColinMackay.net "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius "If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Select Products im filling this dropdown dynamically thro xml and js i want the multiple selected values from thus drop to be a comma separated string and pass it as a parameter to a stored procedure.. and is there a way to pass these multiple values to the where clause of the sp here how to give the multiple values of the serial nos from the string of the sp to this query SELECT ... ... ... WHERE serial_number =@serialNo sathy
-
Select Products im filling this dropdown dynamically thro xml and js i want the multiple selected values from thus drop to be a comma separated string and pass it as a parameter to a stored procedure.. and is there a way to pass these multiple values to the where clause of the sp here how to give the multiple values of the serial nos from the string of the sp to this query SELECT ... ... ... WHERE serial_number =@serialNo sathy
Are you required to use a combobox dropdown? Why I ask is because listboxes can do multiple selections. PJC
-
Are you required to use a combobox dropdown? Why I ask is because listboxes can do multiple selections. PJC
-
Glad you sorted that out. Have a good day, Paul