473,385 Members | 2,274 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1278
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin Bischoff | last post by:
Hi, is it possible to modify the values of a SqlDataSource's select parameters in the code behind before the select command is executed? Example: I have an SqlDataSource with a...
8
by: Mike Kelly | last post by:
I've chosen to implement the "optimistic concurrency" model in my application. To assist in that, I've added a ROWVERSION (TIMESTAMP) column to my main tables. I read the value of the column in my...
3
by: zapov | last post by:
Hi! Did anyone successfully managed to use some custom ADO.NET provider with SqlDataSource? I'd like to connect to some other database than MSSQL (like MySQL, Firebird or PostgreSQL) but I'm...
2
by: cognizance42 | last post by:
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...
3
by: adam222 | last post by:
hello, i have a web-form with a GridView control, i wanted to update & delete, using the AutoGenerateEditButton. when i used it with sqlDataSource (executing SP in the DB) it works like a...
5
by: msch-prv | last post by:
Hi, I am trying to tie a SQLDataSource control to MySQL without success. The connection string works ok with an ObjectDataSource. (Native asp.net 2.0 MySQL dll loaded in /bin) For some reason,...
2
by: djc | last post by:
1) I am wondering if I should be using an sqlDataSource object for my particular scenario. I need to loop through a listbox and perform an INSERT sql operation for each item. Could be a few or...
2
by: Julien Sobrier | last post by:
Hello, I have 2 SqlDataSource on the same page that retrieve the same column names: <asp:SqlDataSource ID="SqlStructure" runat="server" SelectCommand="SELECT a, b FROM c WHERE d = 0 /> ...
0
by: staeri | last post by:
I have a dropdownlist attached to a SqlDataSource inside an Accordion. I receive the following error message when the SqlDataSource is inside the Accordion: "The DataSourceID of 'ddGroup' must...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.