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.
| Author |
Topic |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2009-12-04 : 11:01:00
|
| How do I do that with this stored procedure?@weekdat datetimeAsSET NOCOUNT ONDECLARE @listCol VARCHAR(2000)SELECT @listCol = STUFF(( SELECT DISTINCT '],[' + convert(varchar(10),(Weekdat),1) --converting the weekdat FROM testwhere weekdat = @weekdat + Request.Querystring("dte")Here's the info to pass into the querystring: Dim selectedItems(ListBox1.Items.Count - 1) As Integer Dim numSelectedItems As Integer = 0 For i As Integer = 0 To ListBox1.Items.Count - 1 If ListBox1.Items(i).Selected Then selectedItems(numSelectedItems) = i numSelectedItems += 1 End If Next Dim queryString As String = "" If RadioBtnReg.Checked AndAlso RadioBtnWeek.Checked Then queryString = "test1.aspx?period=m" For i As Integer = 0 To numSelectedItems - 1 queryString &= "&dte" & (i + 1).ToString() & "=" & ListBox1.Items(selectedItems(i)).Value Next End IfHere's the querystring that's passed:http://localhost:3640/stuff/test1.aspx?period=m&dte1=11/20/2009&dte2=11/13/2009&dte3=11/06/2009I need to pass dte2, dte3 etc. |
|
|
weipublic
Starting Member
19 Posts |
Posted - 2009-12-05 : 21:51:50
|
| Add another parameter to the stored procedure, this parameter will accepts the querystring value.When you invoke the stored procedure, just pass the querystring value to this parameter. |
 |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2009-12-07 : 09:55:53
|
| Thanks that worked I didn't even think about that. |
 |
|
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2009-12-07 : 12:15:03
|
| but maybe beware.....http://xkcd.com/327/Charlie===============================================================Msg 3903, Level 16, State 1, Line 1736The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION |
 |
|
|
|
|
|