Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4257158
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:27:10+00:00 2026-05-21T05:27:10+00:00

I have a LinqDataSource defined like this: <asp:LinqDataSource ID=LinqDataSource1 runat=server OnSelecting=LinqDataSource_FileSelecting></asp:LinqDataSource> In LinqDataSource_FileSelecting, it

  • 0

I have a LinqDataSource defined like this:

<asp:LinqDataSource ID="LinqDataSource1" runat="server" OnSelecting="LinqDataSource_FileSelecting"></asp:LinqDataSource>

In LinqDataSource_FileSelecting, it returns/sets a List<string> to e.Result, where e is the EventArgs (LinqDataSourceSelectEventArgs) in the Selecting event of the LinqDataSource. I’m getting this error when the page loads:

“The ContextTypeName property of LinqDataSource ‘LinqDataSource1’ must specify a data context type.”

Based on this message and looking at the docs, I need to set the ContextTypeName and TableName properties of the LinqDataSource. ContextTypeName would normally be the name of a class, and TableName would be the name of an enumerable property within that class.

When the data source is a List<string> I’m not sure what ContextTypeName or TableName I can assign. I’ve tried System.Collections.Generic.List<string> for the ContextTypeName, but that didn’t work, I received “Could not load type ‘System.Collections.Generic.List<string>‘”

I realize the LinqDataSource may not be the appropriate control when the data source is a List<string> generated within the Selecting event. But is there a ContextTypeName and TableName I can set for this scenario?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T05:27:10+00:00Added an answer on May 21, 2026 at 5:27 am

    Found the answer. Turns out that you can omit ContextTypeName and TableName when using the Selecting event and assigning a List<string> to e.Result. However, if you assign null to e.Result, then this error will occur since ASP.NET doesn’t know the type of data. My code on the Selecting event was designed to set a non-null value to e.Result, but a separate problem was leading to null being set to e.Result … leading to this error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a LinqDataSource like this one : <asp:LinqDataSource ID=linqDSUsers runat=server ContextTypeName=Repository.BBDatabaseDataContext Select=new (UserID,FirstName,LastName)
Im using LinqDataSource like that: <asp:LinqDataSource ID=LinqDataSource3 runat=server OnSelecting=LinqDataSource3_OnSelecting> </asp:LinqDataSource> And I have ASPxGridView
I have a connection string defined in my web.config like: <connectionStrings> <add name=LibraryConnectionString connectionString=Server=.\SQLEXPRESS3;Database=Library;Integrated
In my application I have TextBox in a FormView bound to a LinqDataSource like
I have found this example on StackOverflow: var people = new List<Person> { new
I have a LinqDataSource that I use to calculate the number of rows in
I have a gridview that is using a LinqDataSource for it's datasource. I've added
Have you ever seen any of there error messages? -- SQL Server 2000 Could
I have a ASP.NET Website, where, in a GridView item template, automatically populated by
I have asked this question on Telerik forums with no reply so I'm turing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.