← All SmartAdapters Data

SmartQueryAdapter

Generates a result set from a database schema and a plain-language description of what you want.

Attaches to Database schema

Describe the data you need — "customers in Italy who ordered in the last 90 days" — and the adapter turns that, together with the schema it is given, into a query and a returned data set.

It hands non-technical users a way to ask the database questions, and gives developers a head start on the query they would otherwise write by hand.

You stay in control of execution: the adapter produces the query and the result set, and your code decides how it runs — read-only connections, row limits and review steps fit naturally around it.

What it gives you

  • Builds a data set from a schema plus a natural-language request.
  • Bridges business questions and database queries.
  • Useful for ad-hoc reporting and exploratory analysis.

Use it for

  • Ad-hoc reporting for non-technical users
  • Exploratory analysis during live meetings
  • Draft queries developers refine into production SQL

Like every adapter, it runs through a SmartHub and inherits its SmartEndpoint — switching the model or provider never changes this code.

csharp
var hub = new SmartHub(this) { Endpoint = endpoint };

var query = new SmartQueryAdapter { Schema = salesSchema };

DataTable result = await query.RunAsync(
    "Top 10 customers by revenue this year");
dataGridView1.DataSource = result;

Read the SmartQueryAdapter docs ↗