Rinku Power Tools is a Visual Studio extension for managing SQL queries and generating strongly typed ADO.NET code. You define SQL queries, stored procedures, or SQL files using a Visual Studio interface. The extension generates methods that return fully prepared The goal is to remove manual command creation, parameter binding, and repetitive ADO.NET boilerplate. It is designed primarily for use with the Rinku NuGet library, but it also works with raw ADO.NET and Query managementQueries are created and managed using the Visual Studio UI. Each query defines a method that is generated from a SQL statement, stored procedure, or external SQL file. The generated method includes all required SQL parameters in its signature and returns a fully prepared Example: A query named
The method creates the command, sets the SQL text or stored procedure name, and applies all parameters automatically. Result setsIf a query returns multiple columns, a C# record is generated for the first result set. Example:
If the query returns a single value (for example a single ParametersParameters are inferred automatically from the SQL query. Most queries require no configuration. When needed, parameters can be refined using optional overrides to adjust type, nullability, or size. Examples:
Connection string resolutionThe connection string can be resolved from appsettings.json, User Secrets, raw connection strings, .csproj properties, launchSettings.json, etc. Class generationA C# class can be generated from a result set. This is available from the Visual Studio Add menu and is a one-time action. The generated class starts from the same structure as the result set record, allowing easy reuse of the result shape in custom types. This helps avoid boilerplate when you want to use your own model instead of the generated result set record. |