<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Find the maximum line in the attribute table with C# in Esri Tutorials Questions</title>
    <link>https://community.esri.com/t5/esri-tutorials-questions/find-the-maximum-line-in-the-attribute-table-with/m-p/1158120#M622</link>
    <description>&lt;P&gt;Hi everyone!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My teacher gave me an individual assignment. Imagine that you have multiple dataframes (databases). Each of them stores several line layers, which store many lines of different lengths.&lt;/P&gt;&lt;P&gt;He told me to develop a C# tool that would find in each of the dataframes (let's say we had three dataframes) the maximum line in length (in the form of a message), and then display the minimum line from these three maximum lines. That is, I must rely on the parameter SHAPE_Length in the table.&lt;/P&gt;&lt;P&gt;I don't know how to succeed in this. I have a number of questions and I would be very grateful if you could help me!&lt;/P&gt;&lt;P&gt;1. Can I connect to the database using TextBox? For example something like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;dbconnect.OpenWorkspace("" + TextBox1.ToString());&lt;/P&gt;&lt;P&gt;Sorry, I'm really bad at this.&lt;/P&gt;&lt;P&gt;2. With this code, I can only connect to one attribute table with lines:&lt;/P&gt;&lt;P&gt;IFeatureClass pFeatureClass = dbconnect.OpenFeatureClass("my_lines");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I have several line layers in my database? And it is required to turn to each, and among several to find one maximum line. It is a pity that there is no GENERAL attribute table that contains data from all layers. Is it possible to do without this line of code at all? Is there a method to find line layers in my database?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. How to find the maximum line using a query. I have tried almost everything. For example:&lt;/P&gt;&lt;P&gt;pQueryfilter.WhereClause = "SHAPE_Length" "=MAX";&lt;/P&gt;&lt;P&gt;But it doesn't work:(&lt;/P&gt;&lt;P&gt;4. The results of my queries from each dataframe should be written to variables. Then they are compared and the minimum line among them is found. How to implement it?&lt;/P&gt;&lt;P&gt;Sorry for the huge number of questions. I'm attaching a screenshot of the tool below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_0-1648298873270.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37419i8C63C21A08CC14DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_0-1648298873270.png" alt="_0-1648298873270.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Mar 2022 11:22:24 GMT</pubDate>
    <dc:creator>ЭлинаНасырова</dc:creator>
    <dc:date>2022-03-26T11:22:24Z</dc:date>
    <item>
      <title>Find the maximum line in the attribute table with C#</title>
      <link>https://community.esri.com/t5/esri-tutorials-questions/find-the-maximum-line-in-the-attribute-table-with/m-p/1158120#M622</link>
      <description>&lt;P&gt;Hi everyone!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My teacher gave me an individual assignment. Imagine that you have multiple dataframes (databases). Each of them stores several line layers, which store many lines of different lengths.&lt;/P&gt;&lt;P&gt;He told me to develop a C# tool that would find in each of the dataframes (let's say we had three dataframes) the maximum line in length (in the form of a message), and then display the minimum line from these three maximum lines. That is, I must rely on the parameter SHAPE_Length in the table.&lt;/P&gt;&lt;P&gt;I don't know how to succeed in this. I have a number of questions and I would be very grateful if you could help me!&lt;/P&gt;&lt;P&gt;1. Can I connect to the database using TextBox? For example something like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;dbconnect.OpenWorkspace("" + TextBox1.ToString());&lt;/P&gt;&lt;P&gt;Sorry, I'm really bad at this.&lt;/P&gt;&lt;P&gt;2. With this code, I can only connect to one attribute table with lines:&lt;/P&gt;&lt;P&gt;IFeatureClass pFeatureClass = dbconnect.OpenFeatureClass("my_lines");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if I have several line layers in my database? And it is required to turn to each, and among several to find one maximum line. It is a pity that there is no GENERAL attribute table that contains data from all layers. Is it possible to do without this line of code at all? Is there a method to find line layers in my database?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. How to find the maximum line using a query. I have tried almost everything. For example:&lt;/P&gt;&lt;P&gt;pQueryfilter.WhereClause = "SHAPE_Length" "=MAX";&lt;/P&gt;&lt;P&gt;But it doesn't work:(&lt;/P&gt;&lt;P&gt;4. The results of my queries from each dataframe should be written to variables. Then they are compared and the minimum line among them is found. How to implement it?&lt;/P&gt;&lt;P&gt;Sorry for the huge number of questions. I'm attaching a screenshot of the tool below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_0-1648298873270.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/37419i8C63C21A08CC14DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_0-1648298873270.png" alt="_0-1648298873270.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Mar 2022 11:22:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-tutorials-questions/find-the-maximum-line-in-the-attribute-table-with/m-p/1158120#M622</guid>
      <dc:creator>ЭлинаНасырова</dc:creator>
      <dc:date>2022-03-26T11:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Find the maximum line in the attribute table with C#</title>
      <link>https://community.esri.com/t5/esri-tutorials-questions/find-the-maximum-line-in-the-attribute-table-with/m-p/1158223#M625</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which Esri developer tool/SDK are you using? If you let us know we can move this post to a more appropriate Question board.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 27 Mar 2022 22:56:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/esri-tutorials-questions/find-the-maximum-line-in-the-attribute-table-with/m-p/1158223#M625</guid>
      <dc:creator>AdenaSchutzberg1</dc:creator>
      <dc:date>2022-03-27T22:56:27Z</dc:date>
    </item>
  </channel>
</rss>

