Getting The Value Of An UpdateParameter
Sep 26, 2007Hi,
I have a SqlDataSource with UpdateParameters and am trying to get their values.
I tried something like this:
cmd.Parameters.Add("ProjectManagerID", SqlDbType.Int).Value = CType(SqlDataSource1.UpdateParameters("ProjectManagerID").ToString, Int32)
cmd.Parameters.Add("RequestedBy", SqlDbType.VarChar).Value = SqlDataSource1.UpdateParameters("RequestedBy").ToString
cmd.Parameters.Add("DateRequested", SqlDbType.DateTime).Value = CType(SqlDataSource1.UpdateParameters("DateRequested").ToString, DateTime)
but that's obviously not right.
I'm trying to do something like:
cmd.Parameters.Add("ProjectManagerID", SqlDbType.Int).Value = CType(SqlDataSource1.UpdateParameters("ProjectManagerID").Value.ToString, Int32)
cmd.Parameters.Add("RequestedBy", SqlDbType.VarChar).Value = SqlDataSource1.UpdateParameters("RequestedBy").Value.ToString
cmd.Parameters.Add("DateRequested", SqlDbType.DateTime).Value = CType(SqlDataSource1.UpdateParameters("DateRequested").Value.ToString, DateTime)
(if there were a method called 'Value' for UpdateParameter)
Any ideas?
Thanks.