Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why some parameters are duplicated in the code of data source

Posted on 2012-03-18
2
Medium Priority
?
420 Views
Last Modified: 2012-03-18
Hi:

We're creating some web application using VS 2010 with Visual Basic.

We try to insert a new record into an ACCESS table, or update/delete an existing record using DetailsView associated with AccessDataSource

We configure DetailsView to bind with the AccessDataSource and also configure the AccessDataSource for SELECT, INSERT, UPDATE, and DELETE statements.

In DetailsView we check "Enable Inserting", "Enable Editing", "Enable Deleting"

We currently have a problem with editing, deleting, and inserting. We're trying to figure out what causes the problem. We looked into the auto-generated code of AccessDataSource. We found that some parameters are duplicated:

In <DeleteParameters> and <UpdateParameters>, the parameters "Amount" and "Tax" are duplicated. (I've bolded them in the below source code).

Would you help to look into these and let us know if this is some kind of error or why they're duplicated.

Thanks a lot for any help,

Somits

//---------------------------

<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/Database3.accdb"
               SelectCommand="SELECT * FROM [vb_access_db3_tb2]"
ConflictDetection="CompareAllValues"
               DeleteCommand="DELETE FROM [vb_access_db3_tb2] WHERE
(([Order ID] = ?) OR ([Order ID] IS NULL AND ? IS NULL)) AND
(([Amount] = ?) OR ([Amount] IS NULL AND ? IS NULL)) AND (([Tax] = ?)
OR ([Tax] IS NULL AND ? IS NULL))"
               InsertCommand="INSERT INTO [vb_access_db3_tb2] ([Order
ID], [Amount], [Tax]) VALUES (?, ?, ?)"
               OldValuesParameterFormatString="original_{0}"
               UpdateCommand="UPDATE [vb_access_db3_tb2] SET [Amount]
= ?, [Tax] = ? WHERE (([Order ID] = ?) OR ([Order ID] IS NULL AND ? IS
NULL)) AND (([Amount] = ?) OR ([Amount] IS NULL AND ? IS NULL)) AND
(([Tax] = ?) OR ([Tax] IS NULL AND ? IS NULL))">
               <DeleteParameters>
                   <asp:Parameter Name="original_Order_ID" Type="String" />
                   <asp:Parameter Name="original_Amount" Type="Double" />
                   <asp:Parameter Name="original_Amount" Type="Double" />
                   <asp:Parameter Name="original_Tax" Type="Double" />
                   <asp:Parameter Name="original_Tax" Type="Double" />

               </DeleteParameters>
               <InsertParameters>
                   <asp:Parameter Name="Order_ID" Type="String" />
                   <asp:Parameter Name="Amount" Type="Double" />
                   <asp:Parameter Name="Tax" Type="Double" />
               </InsertParameters>
               <UpdateParameters>
                   <asp:Parameter Name="Amount" Type="Double" />
                   <asp:Parameter Name="Tax" Type="Double" />
                  <asp:Parameter Name="original_Order_ID" Type="String" />
                   <asp:Parameter Name="original_Amount" Type="Double" />
                   <asp:Parameter Name="original_Amount" Type="Double" />
                   <asp:Parameter Name="original_Tax" Type="Double" />

                   <asp:Parameter Name="original_Tax" Type="Double" />
               </UpdateParameters>
           </asp:AccessDataSource>

//---------------------------
0
Comment
Question by:somits
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Triskelion earned 2000 total points
ID: 37734754
This looks like a bug in th auto generator.
If you delete the duplicate lines, is everything OK?

Was the wizard run more than once?
Was there any manual manipulation of the code or the schema between runs of the wizard?
0
 

Author Comment

by:somits
ID: 37734863
Hi Triskelion:

You're right. I run the wizardc more than once.

I deleted the data source and reconfigure it. The duplication is gone.
However, I still could not update the record or delete it or insert the new one.

I still miss something that cause this error. If you've some idea about this, please help me in another question.

Thanks a lot.

Somits
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question