Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

SqlClient Introduction

Aleksey Nemiro edited this page Apr 3, 2014 · 3 revisions

SqlClient is main class for work with SQL Server.

Class has a five simple methods:

  • GetData - get DataSet;
  • GetTable;
  • GetRow;
  • ExecuteScalar;
  • ExecuteNonQuery.

Each of the methods has three overloads:

  • Without parameters, to use the command from an instance of SqlClient;
  • With specifying text T-SQL statement (not recommended);
  • With specifying SqlCommand instance.

For using convenience of the SqlClient class, it is recommended to add a database connection string to the configuration file: