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 5966541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:48:51+00:00 2026-05-22T19:48:51+00:00

in the above query it is giving error i want to fetch top record

  • 0

in the above query it is giving error i want to fetch top record and store in some string variable of columns of query like string s=zipcd.zipcode

var zipcd = (from u in db.ZipCodes1
                                         where u.CityName == temparray[0].Trim() && u.StateAbbr == temparray[1].Trim() && u.CityType == "D"
                                         select new Viewsearch
                                         {
                                             Zipcode = u.ZIPCode,
                                             CityName = u.CityName,
                                             stateabbr = u.StateAbbr

                                         }).First();
                            Viewsearch vs = (Viewsearch)zipcd;
                            string description = (new ObservableCollection<Viewsearch>(zipcd))[0].Zipcode.ToString();


                        locationarray = vs.Zipcode + " " + vs.CityName + ", " + vs.stateabbr;
  • 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-22T19:48:52+00:00Added an answer on May 22, 2026 at 7:48 pm
    var city = temparray[0].Trim();
    var stat = temparray[1].Trim();
    var zipcd = db.ZipCodes1
      .Where(u => u.CityName == city && u.StateAbbr == stat && u.CityType == "D")
      .Select(new Viewsearch { Zipcode = u.ZIPCode, u.CityName, stateabbr = u.StateAbbr })
      .First();
    locationarray = zipcd.Zipcode + " " + zipcd.CityName + ", " + zipcd.stateabbr;
    

    This should work.

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

Sidebar

Related Questions

When I run my final query I am getting the above error. I've set
From the above sample data, i want to write a query that will return
I tried the below query but it didnt executed giving error as : >
I want to store mysql query in zend registry because i have one action
MySQL is giving a 1064 on an escaped string. $date is set above. $article_clean
I want to make sure a file path set via query string does not
I have a hibernate query in grails Book.findAllByRating(4) In the above query i want
I have a string with some numeric value. I want to format it in
select station_id,count(case_id) from emer_complaint group by station_id Above query returning the correct result. But,
UPDATE UPI_ATTRIBUTE SET SITE_INC ='0' WHERE USER_PROFILING_NAME IN ('CAR_IMPLICIT','CAR_EXPLICIT') Above is my query that

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.