Advertisement

09.04.2008 at 06:42PM PDT, ID: 23704901
[x]
Attachment Details

Error with LINQ Datasource

[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3
Tags:

ASPNET, C#, LINQ, All, Operator '=' incompatible with operand types 'Int32' and 'Object'

Hello Experts,

I am writing my web app, and I made a dicision half way through development
(Maybe I should have just stuck to what i was doing to start with) and moved from SqlDataSources to LINQ DataSources.

I made my .dbml file and added datasources to my page built my app then bound the datasources to my radgrids, I am using automatic Updates, Inserts, Deletes with optimistic concurrency.

My DataSources are attached bound to a session variable.

when i run my app i get an error as described in the attached image.

Cheers

Trent
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DataClassesDataContext"
                                Select="new (CustomerID, CMAID, Name_Contact, Name_First, Name_Last, PrefferedContactMethod, Phone_Business, Mobile_Business, Fax_Business, Email_Business, Phone_Private, SAPVendor, StateID, LocationID, Postcode, Latitude, Longtitude, CARMSID)"
                                TableName="customers_data_0_details" Where="CustomerID == @CustomerID &amp;&amp; CMAID == @CMAID">
                                <WhereParameters>
                                    <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="Int32" />
                                    <asp:SessionParameter Name="CMAID" SessionField="CMAID" Type="Int32" />
                                </WhereParameters>
                            </asp:LinqDataSource>
                            <asp:LinqDataSource ID="StatesDS" runat="server" ContextTypeName="DataClassesDataContext"
                                OrderBy="State" TableName="shared_lut_state_names">
                            </asp:LinqDataSource>
                            <asp:LinqDataSource ID="TownDS" runat="server" ContextTypeName="DataClassesDataContext"
                                OrderBy="Town" Select="new (LocationID, Town, CMAID)" TableName="customers_lut_locations"
                                Where="CMAID == @CMAID">
                                <WhereParameters>
                                    <asp:SessionParameter Name="CMAID" SessionField="CMAID" Type="Int32" />
                                </WhereParameters>
                            </asp:LinqDataSource>
                            <asp:LinqDataSource ID="PostcodeDS" runat="server" ContextTypeName="DataClassesDataContext"
                                OrderBy="Town" Select="new (LocationID, Postcode, CMAID, Town)" TableName="customers_lut_locations"
                                Where="CMAID == @CMAID">
                                <WhereParameters>
                                    <asp:SessionParameter Name="CMAID" SessionField="CMAID" Type="Int32" />
                                </WhereParameters>
                            </asp:LinqDataSource>
Attachments:
 
LINQ Error
LINQ Error
 
 
Accepted Solution by TKOTC:

All comments and solutions are available to Premium Service Members only. Start your 7-day free trial to view the solution to this question.

Already a member? Login to view this solution.

 
 
20081119-EE-VQP-45 / EE_QW_2_20070628