1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c#

Last updated at Posted at 2016-10-02

REPL

まずはインタラクティブシェルで基本操作をつかむといい

タイプチェック

ref:https://msdn.microsoft.com/ja-jp/library/58918ffs.aspx

System.Type 型として型を確認できる。

System.Type type = typeof(int);

ADO.net

MSのコネクションプールの説明
https://msdn.microsoft.com/ja-jp/library/8xx3tyca(v=vs.110).aspx
接続文字列まとめ
http://www.dofactory.com/reference/connection-strings
自習書
https://msdn.microsoft.com/ja-jp/data/gg615417
code example
https://msdn.microsoft.com/en-us/library/dw70f090(v=vs.110).aspx

DB接続設定

デフォルト https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx
poolの指定 http://www.codeproject.com/Articles/17768/ADO-NET-Connection-Pooling-at-a-Glance
デフォルトのコネクションプールサイズは100.
正確には
maxconnection: 100
minconnection : 1

コネクション文字列で、チューニング可能

String connectionString = "Data Source=sql01\\MSSQLSERVER02;" +
              "Initial Catalog=syncdb;" +
              "Min Pool Size=100;" + // 最小プールサイズを100に変更
              "User ID=test;" +
              "Password=password;";

認証モードの違い

To connect to the database server is recommended to use Windows Authentication, commonly known as integrated security. To specify the Windows authentication, you can use any of the following two key-value pairs with the data provider. NET Framework for SQL Server:

Integrated Security = true;
Integrated Security = SSPI;
However, only the second works with the data provider .NET Framework OleDb. If you set Integrated Security = true for ConnectionString an exception is thrown.

To specify the Windows authentication in the data provider. NET Framework for ODBC, you should use the following key-value pair.

Trusted_Connection = yes;

パフォーマンスカウンターで、利用されている接続、最大接続数の確認が可能

typeperf "\.NET Data Provider for SqlServer(*)\NumberOfPooledConnections"
typeperf "\.NET Data Provider for SqlServer(*)\NumberOfActiveConnectionPools"
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?