{"id":28586,"date":"2020-08-31T12:18:52","date_gmt":"2020-08-31T12:18:52","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?p=28586"},"modified":"2024-05-06T06:33:51","modified_gmt":"2024-05-06T06:33:51","slug":"how-to-use-csqry-using-comapi-in-c","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/","title":{"rendered":"How to use CSQRY using COMAPI in C#"},"content":{"rendered":"\n<p>CSQRY is the standard Sage 300 View CS0120. It basically takes the SQL Query as the parameter to its Browse method and then returns the records via calls to Fetch. CSQRY is easy to execute general SQL statements through the Sage 300 API. This way we don\u2019t need additional database credentials and don\u2019t need to use an alternate API like ODBC.<\/p>\n\n\n\n<p><strong>New Stuff:<\/strong> <a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/sage-300c-2020-pu2-released-has-fixed-the-issue-related-to-order-entry-screen\/\" target=\"_blank\" rel=\"noreferrer noopener\">Sage 300c 2020 PU2 released has fixed the issue related to Order Entry screen<\/a><\/p>\n\n\n\n<p><strong>Step 1:<\/strong><\/p>\n\n\n\n<p>Include the Sage 300 COMAPI in the project.<\/p>\n\n\n\n<p><strong>Step 2:<\/strong><\/p>\n\n\n\n<p>Once the COMAPI is included, create the object of the DBLink and open the \u201cCS0120\u201d using DBLink object.<\/p>\n\n\n\n<p><strong>Step 3:<\/strong><\/p>\n\n\n\n<p>Pass the SQL Query in Browse method as string parameter.<\/p>\n\n\n\n<p><strong>Step 4:<\/strong><\/p>\n\n\n\n<p>Now we call the Fetch method to return the results.<\/p>\n\n\n\n<p>Here is the sample code of how to use CSQRY view using COMAPI, just in case you are not aware of how to use it\u2026<\/p>\n\n\n\n<center><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px;\nalign: center;\" src=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg\" alt=\"CSQRY\"><\/a><\/center><font size=\"2\"><center><i>GUMU Integration App<\/i><\/center><\/font>\n\n\n\n<p>The result will comes up as per the SQl statement and which can be used for further operations.<\/p>\n\n\n\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Greytrix<\/a>&nbsp;&#8211; a globally recognized and one of the\noldest Sage Gold Development Partner is a one-stop solution provider for Sage\nERP and Sage CRM organizational needs. Being acknowledged and rewarded for\nmulti-man years of experience, we bring complete end-to-end assistance for your\ntechnical consultations, product customizations, data migration, system\nintegrations, third party add-on development and implementation competence.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>&nbsp;offers unique GUMU&#x2122; integrated solutions of&nbsp;&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-300-erp-integration\">Sage 300 with Sage CRM,<\/a>&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/gumu-300-salesforce-integration\">Salesforce.com<\/a>, Dynamics 365 CRM and&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp\/ecommerce-magento-integration\">Magento eCommerce<\/a>&nbsp;along with Sage 300 Migration from&nbsp;<a href=\"https:\/\/www.greytrix.com\/resources\/sage-erp-crm-migration.pdf\">Sage 50 US, Sage 50 CA, Sage PRO, QuickBooks, Sage Business Vision and Sage Business Works<\/a>. We also offer best-in-class&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-300-erp-development\">Sage 300 customization and development services<\/a>&nbsp;and integration services for applications such as&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-300-integration-services\">POS | WMS | Payroll | Shipping System | Business Intelligence | eCommerce for Sage 300 ERP<\/a>&nbsp;and for Sage 300c development services we offer, upgrades of older codes and screens to new web screens, latest integrations using sData and web services &nbsp;to Sage business partners, end users and Sage PSG worldwide. Greytrix offers 20+ addons for Sage 300 to enhance productivity such as&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/greymatrix-apparel-solution\">GreyMatrix<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/greytrix-document-attachement\">Document Attachment<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/greytrix-document-numbering\">Document Numbering<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/auto-bank-reconciliation\">Auto-Bank Reconciliation<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/purchase-approval-system\">Purchase Approval System<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/three-way-po-matching\">Three way PO matching<\/a>,&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/bill-of-lading\">Bill of Lading<\/a>&nbsp;and&nbsp;<a href=\"https:\/\/www.greytrix.com\/product\/sage-300-erp-add-ons\/vat-middle-east\">VAT for Middle East<\/a>. The GUMU&#x2122; integration for Dynamics 365 CRM \u2013 Sage ERP is listed on Microsoft Appsource with easy implementation package.<\/p>\n\n\n\n<p>For more details on Sage 300 and Sage 300c Services, please\ncontact us at&nbsp;<a href=\"mailto:accpac@greytrix.com\">accpac@greytrix.com<\/a>,\nWe will like to hear from you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSQRY is the standard Sage 300 View CS0120. It basically takes the SQL Query as the parameter to its Browse method and then returns the records via calls to Fetch. CSQRY is easy to execute general SQL statements through the Sage 300 API. This way we don\u2019t need additional database credentials and don\u2019t need to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5],"tags":[93,3534,2415,2416,2451,2730,2959],"class_list":["post-28586","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","category-accpac-sdk","tag-accpac-views","tag-cs0120","tag-sage-300-technical-assistance","tag-sage-300-technical-blogs","tag-sage-accpac-erp","tag-sql-queries-through-accpac-view","tag-using-sql-queries"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to utilize CSQRY with COMAPI in C#?<\/title>\n<meta name=\"description\" content=\"Discover CSQRY is the default Sage 300 View CS0120. It basically takes the SQL query as an argument to its Browse method and returns the results via Fetch operations.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to utilize CSQRY with COMAPI in C#?\" \/>\n<meta property=\"og:description\" content=\"Discover CSQRY is the default Sage 300 View CS0120. It basically takes the SQL query as an argument to its Browse method and returns the results via Fetch operations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-31T12:18:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T06:33:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg\" \/>\n<meta name=\"author\" content=\"Greytrix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greytrix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/\",\"name\":\"How to utilize CSQRY with COMAPI in C#?\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg\",\"datePublished\":\"2020-08-31T12:18:52+00:00\",\"dateModified\":\"2024-05-06T06:33:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2\"},\"description\":\"Discover CSQRY is the default Sage 300 View CS0120. It basically takes the SQL query as an argument to its Browse method and returns the results via Fetch operations.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#primaryimage\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg\",\"contentUrl\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use CSQRY using COMAPI in C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\",\"name\":\"Sage 300 ERP \u2013 Tips, Tricks and Components\",\"description\":\"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! \",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2\",\"name\":\"Greytrix\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g\",\"caption\":\"Greytrix\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/greytrix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to utilize CSQRY with COMAPI in C#?","description":"Discover CSQRY is the default Sage 300 View CS0120. It basically takes the SQL query as an argument to its Browse method and returns the results via Fetch operations.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/","og_locale":"en_US","og_type":"article","og_title":"How to utilize CSQRY with COMAPI in C#?","og_description":"Discover CSQRY is the default Sage 300 View CS0120. It basically takes the SQL query as an argument to its Browse method and returns the results via Fetch operations.","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2020-08-31T12:18:52+00:00","article_modified_time":"2024-05-06T06:33:51+00:00","og_image":[{"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg","type":"","width":"","height":""}],"author":"Greytrix","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Greytrix","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/","name":"How to utilize CSQRY with COMAPI in C#?","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#primaryimage"},"thumbnailUrl":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg","datePublished":"2020-08-31T12:18:52+00:00","dateModified":"2024-05-06T06:33:51+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2"},"description":"Discover CSQRY is the default Sage 300 View CS0120. It basically takes the SQL query as an argument to its Browse method and returns the results via Fetch operations.","breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#primaryimage","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg","contentUrl":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2020\/08\/Img.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2020\/08\/31\/how-to-use-csqry-using-comapi-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"How to use CSQRY using COMAPI in C#"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/","name":"Sage 300 ERP \u2013 Tips, Tricks and Components","description":"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2","name":"Greytrix","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g","caption":"Greytrix"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/greytrix\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/28586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=28586"}],"version-history":[{"count":2,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/28586\/revisions"}],"predecessor-version":[{"id":28606,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/28586\/revisions\/28606"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=28586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=28586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=28586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}