SqlDataSource UpdateParameters

G

Guest

Can someone offer some insight of why parameters outside of those contained
in a SqlDataSource <UpdateParameters> section would show up in a profiler
trace?

I'm using:
<UpdateParameters>
<asp:parameter Name="MerchID" Type="Int32" />
<asp:parameter Name="Merchant" Type="String" />
<asp:parameter Name="ModifiedBy" Type="String" />
</UpdateParameters>

In the SQL Server Profiler I see:

exec spu_merch
@Merchant=N'test',@ModifiedBy=N'jkayne',@MerchID=1,@ModifiedDate=''2006-02-28
12:35:46:917'',@EnteredDate=''2003-10-22 10:29:36:280''

I can't seem to figure out where ModifiedDate and EnteredDate are coming from.
These are optional in my stored procedure and I'd expect to see the folowing
in my profiler trace:

exec spu_merch @Merchant=N'test',@ModifiedBy=N'jkayne',@MerchID=1

Any insight would be extremely appreciated!
 
B

Brooke

Do the two date fields have a default value assigned in the table or a
trigger using GETDATE()?
 
G

Guest

Brooke,

The two date fields do not have a default value.

The table does have a trigger that updates these two columns, but I still
wouldn't expect to see the values passed to the stored procedure from the
SqlDataSource would I?

The stored procedure accepts the following parameters allowing the dates to
be optional:

@MerchID int
, @Merchant varchar (64)
, @ModifiedBy nvarchar (256)
, @ModifiedDate datetime = null
, @EnteredDate datetime = null
, @RowCount int = 0 output
 
G

Guest

The UpdateParameters do not exclude any of the 2-way databound fields that
match the parameters in your stored proc. If you remove all of the
UpdateParameters your GridView will still work. The values that you are
getting into ModifiedDate and EneterdDate are from the Bind expressions in
your GridView. If you replace Bind with Eval for those 2 columns in the
GridView you will get null passed to the stored proc for those 2 parameters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top