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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:12:25+00:00 2026-06-04T21:12:25+00:00

I have the below query in access 2007 which gave me correct results using

  • 0

I have the below query in access 2007 which gave me correct results using the sql design view of access..

  SELECT B1.LAYER_TYPE,
  B1.LAYER_NAME AS LAYER_NAME,
  B2.LAYER_NAME AS RELATED_LAYER_NAME,
  B3.LAYER_NAME AS RELATED_LAYER2_NAME,
  C.RULE_NAME
  FROM (((NCS_RULES_RELATIONS AS A
  LEFT JOIN NCS_LAYERS AS B1 ON A.LAYER_ID = B1.LAYER_ID)
  LEFT JOIN NCS_LAYERS AS B2 ON A.RELTD_LAYER_ID = B2.LAYER_ID)
  LEFT JOIN NCS_LAYERS AS B3 ON A.RELTD_LAYER2_ID = B3.LAYER_ID)
  LEFT JOIN NCS_RULES AS C ON A.RULE_ID = C.RULE_ID
  ORDER BY B1.LAYER_TYPE;

the results are below :

query results in access

but when i try to get the results to a datatable using c# and oledbconnection to access, the RULE_NAME field value for the last row shows weird results(see pic below).

from visualstudio

my code for retrieving table is below:

public DataTable GetTable(string strSelectSQL)
        {
            if (this.con.State != ConnectionState.Open)
                con.Open();

            DataTable dt = new DataTable();
            DataSet ds = new DataSet();
            IDbCommand command = con.CreateCommand();
            command.CommandText = strSelectSQL;
            command.Connection = con;

            IDbDataAdapter da = factory.CreateDataAdapter();
            da.SelectCommand = command;
            da.Fill(ds);

            dt = ds.Tables[0];

            con.Close();
            return dt;

        }

can somebody help me with this strange behavior?

  • 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-06-04T21:12:26+00:00Added an answer on June 4, 2026 at 9:12 pm

    Seems everything is fine. My guess you have multiline value in Rule_name field like this: AnnoFromLine\n\rDimOnLine. Datagridview displaying multiline value as you can see and sql design view diplaying just first line.

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

Sidebar

Related Questions

I'm using Sql-Server, and I have the below query which returns all columns that
Access 2007 / SQL / VB I have a query: SELECT Count(*) AS CountOfCR1
I have RO access on a SQL View. This query below times out. How
I am using Access 2007 to create an SQL query to join two tables.
I have the following Query which produces the output below; SELECT TBLUSERS.USERID, TBLUSERS.ADusername, TBLACCESSLEVELS.ACCESSLEVELID,
I have an SQL query: SELECT ShipVia, SUM(Freight) FROM Orders GROUP BY ShipVia which
We have the query below. Using a LEFT OUTER join takes 9 seconds to
I have an SQL query (below) that essentially takes a student from tbStudents, and
I have a problem with the query below in postgres SELECT u.username,l.description,l.ip,SUBSTRING(l.createdate,0,11) as createdate,l.action
I'm using Microsoft SQL Svr Mgmt Studio 2008. I don't have access to create

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.