471,315 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,315 software developers and data experts.

SqlDataSource UpdateParemeters

Hey gang,

I'm in the process of fixing an application a former programmer slap
together. We found the database design went against company standards,
so our DBA went through to fix her up. Now I'm working on the task of
fixing the UI code to interact properly with the new changes.

However, I've ran in to a strange behavior with UpdateParameters within
my SqlDataSource.

Originally, the Stored Proc calls for the following parameters:

@id int = 0,
@original_id int = 0,
@original_division_id int = 0,
@division int = 0,
@division_id int = 0,
@revenue_type varchar(100) = '',
@revenue_num int = 0

Our DBA changed to:

@original_id int = 0,
@original_division_id int = 0,
@division int = 0,
@division_id int = 0,
@revenue_type varchar(100) = '',
@revenue_num int = 0

The difference? @id has been removed. (Original programmer wasn't even
friggin using it!)

Now I've updated my SqlDataSource UpdateParameters to reflect changes,
only to find when running SQL Profiler that my stored proc is being
executed with 1 added parameter... <b>@id</b>!!

exec updRevenueType @original_id = 15, @original_division_id = 2,
@division = 2, @division_id = 2, @revenue_type = N'Broadcast
Designeeee', @revenue_num = 4020, @id = 15

Does SqlDataSource do some weirdness on the background I'm unaware of
that looks at the database scheme or something and add it's own
parameters? This is rather frustrating trying to find out where this
stray parameter is coming from! Anyone else run in to similar behavior?

More info: I'm using C# on .NET 2.0

Dec 5 '05 #1
1 1214
Turns out the original programmer had over-head in his code. setting
update parameters when he didn't need to. It threw me off, without
realizing the gridview is relying on databound controls for parameters.

Dec 6 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Martin Bischoff | last post: by
3 posts views Thread by zapov | last post: by
2 posts views Thread by cognizance42 | last post: by
5 posts views Thread by msch-prv | last post: by
2 posts views Thread by djc | last post: by
2 posts views Thread by Julien Sobrier | last post: by
reply views Thread by staeri | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.