View Single Post
  #3 (permalink)  
Old July 30th, 2012, 12:03 PM
sophia sophia is offline
Friend of Wrox
Points: 1,469, Level: 15
Points: 1,469, Level: 15 Points: 1,469, Level: 15 Points: 1,469, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Hi, I am getting error "For the EntityDataSource, either Type or DbType (but not both) must be specified for each Parameter."

If I type DbType="Guid" then I get another error "'DailyCollection' is not a member of type 'ASPNETDBModel.DailyCollection' in the currently loaded schemas. Near simple identifier, line 6, column 4."

Please tell me what is the issue?
I am using this code.

Code:
<asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=ASPNETDBEntities" 
        DefaultContainerName="ASPNETDBEntities" EnableDelete="True" 
        EnableFlattening="False" EnableInsert="True" EnableUpdate="True" 
        EntitySetName="Clients" oninserting="EntityDataSource1_Inserting" 
        EntityTypeFilter="" Select="" Where="it.DailyCollection.UserId=@userId">
        <WhereParameters>
                <asp:SessionParameter Name="userId" SessionField="UserID" DbType="Guid" />
        </WhereParameters>
    </asp:EntityDataSource>
And code behind's Page_Load is

Code:
protected void Page_Load(object sender, EventArgs e)
    {
        Session["UserID"] = Membership.GetUser().ProviderUserKey;
     }
Reply With Quote