Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 store procedure

Author  Topic 

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-04-20 : 02:38:42
hello
iam using store procedure to open the the selected rows in datagrid into Excel.but iam getting blank spreadsheet.the querystrings are getting passed but the rows turn out to be blank.
if i do not use store procedure than everything is ok.the querystring contains multiple strings so as to display it in excel.
the stroe procedure is

CREATE PROCEDURE Employee_ExcelDisplayHO(@ID varchar(100))
AS
SELECT * FROM employee_master WHERE empuser_id IN (@ID)


and this is the statement that i use in my .aspxpage to call store procedure

Dim Cmd As New SqlDataAdapter("Employee_ExcelDisplayHO", myconn)
cmd.SelectCommand.CommandType = CommandType.StoredProcedure
cmd.SelectCommand.Parameters.Add(New SqlParameter("ID", SqlDbType.VarChar, 100))
cmd.SelectCommand.Parameters("@ID").Value = Request.QueryString("ID")

any suggestions wht may be wrong

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-20 : 03:24:44
i suspect the @id is a list of id's you want to query? -- just hinting at the 'in' your using

use a split function first on @id...i believe corey has one at his weblog...

select * from employee_master where empuser in (select field1 from fnSplit(@id))

or you can use patindex

--------------------
keeping it simple...
Go to Top of Page

hotshot_21
Yak Posting Veteran

97 Posts

Posted - 2006-04-20 : 03:35:22
yes iam expecting list of ID's .can u expalin u r solution a bit more
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-20 : 04:01:28
Search for where in @MYCSV in this topic
http://sqlteam.com/forums/topic.asp?TOPIC_ID=55210

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -