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

  • Home
  • SEARCH
  • 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 3243970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:29:44+00:00 2026-05-17T18:29:44+00:00

I have a query that will go away an and find data Dim HSNs

  • 0

I have a query that will go away an and find data

 Dim HSNs As String = String.Join(",", ListOfHSNs.Cast(Of String)().ToArray())



        Dim query As String = "SELECT VALUE O FROM v_BillData AS O WHERE O.HSNumber IN {'" & HSNs & "'}"



        Dim hs As New ObjectQuery(Of v_BillData)(query, CType(Session("ObjectCon"), ObjectContext))

what I now wish to do is to use the results of this query to databind to a EntityDataSource
How can I do this?

  • 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-17T18:29:45+00:00Added an answer on May 17, 2026 at 6:29 pm

    You can try to use the Selecting EntityDataSource event like in the following example:

    
    Protected Sub EntityDataSource1_Selecting(ByVal sender As Object, ByVal e As EntityDataSourceSelectingEventArgs)
      Dim HSNs As String = String.Join(",", ListOfHSNs.Cast(Of String)().ToArray())
      Dim query As String = "SELECT VALUE O FROM v_BillData AS O WHERE O.HSNumber IN {'" & HSNs & "'}"
      Dim source As EntityDataSource = Nothing
      source = TryCast(Me.Page.FindControl("EntityDataSource1"),EntityDataSource)
      If (Not source Is Nothing) Then
        source.EntitySetName = Nothing
        source.CommandText = query
      End If
    End Sub

    You should set EntitySetName to Nothing because it will throw an error if you have setup EntityDataSource before.

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

Sidebar

Related Questions

In my code I have a query that looks like this: $load_query = LOAD
I need to write an NHibernate query that will place a restriction that accesses
I have a form that is going to be executing a failry long running
We have a white-labelled platform built on Asp.Net MVC2. At present the site has
I'm building the search in an application and need to have a way of
I have criteria saved within the records of a criteria table which I'm using
Basically the question above, you don't need to read the lot below, just additional
I'm using Google App Engine for Java with the JDO interface for the datastorage
I'm working on writing a web application using php & mysql, and was wondering

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.