> > Here's my stored procedure:
>
[quoted text clipped - 55 lines]
>
> - Show quoted text -
Yes I want to see which button is clicked, Sorry I left out some of
the code.
Tried this but it's still not working
.Parameters.AddWithValue("@Button" Button10)
Code below
Protected Sub Button10_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button10.Click
Session("Mod") = DropDownList1.SelectedValue
Session("Fromdate") = FromDte.Text 'used to grab info from the
two text boxes on the aspx page
Session("toDate") = ToDTE.Text
Dim conn As New
Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("SPSConnectionString").ConnectionString)
Dim cmd As New Data.SqlClient.SqlCommand
Dim cmdSampling As New Data.SqlClient.SqlCommand
With cmdSampling
.CommandType = Data.CommandType.StoredProcedure
.CommandText = "GetSampling"
.Connection = conn
.Parameters.AddWithValue("@mod",
DropDownList1.SelectedValue)
.Parameters.AddWithValue("@Button" Button10)
.Parameters.AddWithValue("@FromDate", FromDte.Text)
.Parameters.AddWithValue("@ToDate", ToDTE.Text)
Response.Redirect("SamplingReport.aspx")
End With
End Sub
Lloyd Sheen - 07 Apr 2008 17:24 GMT
On Apr 7, 11:12 am, "Lloyd Sheen" <a...@b.c> wrote:
> "JJ297" <nc...@yahoo.com> wrote in message
>
[quoted text clipped - 60 lines]
>
> - Show quoted text -
Yes I want to see which button is clicked, Sorry I left out some of
the code.
Tried this but it's still not working
.Parameters.AddWithValue("@Button" Button10)
Code below
Protected Sub Button10_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button10.Click
Session("Mod") = DropDownList1.SelectedValue
Session("Fromdate") = FromDte.Text 'used to grab info from the
two text boxes on the aspx page
Session("toDate") = ToDTE.Text
Dim conn As New
Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("SPSConnectionString").ConnectionString)
Dim cmd As New Data.SqlClient.SqlCommand
Dim cmdSampling As New Data.SqlClient.SqlCommand
With cmdSampling
.CommandType = Data.CommandType.StoredProcedure
.CommandText = "GetSampling"
.Connection = conn
.Parameters.AddWithValue("@mod",
DropDownList1.SelectedValue)
.Parameters.AddWithValue("@Button" Button10)
.Parameters.AddWithValue("@FromDate", FromDte.Text)
.Parameters.AddWithValue("@ToDate", ToDTE.Text)
Response.Redirect("SamplingReport.aspx")
End With
End Sub
You are trying to use the Button rather than either the Button.text or
Button.clientid.
You should turn option strict and option explicit on. If you do then you
will get much more meaningful error messages before you attempt to test.
Hope this helps
LLoyd Sheen
JJ297 - 07 Apr 2008 19:44 GMT
> On Apr 7, 11:12 am, "Lloyd Sheen" <a...@b.c> wrote:
>
[quoted text clipped - 111 lines]
>
> - Show quoted text -
Thanks got it now!