SqlDataSource UpdateParemeters

    Date: 12/06/05 (Asp Dot Net)    Keywords: database, sql

    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... @id!!

    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

    Source: http://www.livejournal.com/community/aspdotnet/50533.html

« Dumb SQL Server Query question || Retrieving values from... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home