SQLiteコマンド. [詳細]
Public メソッド | |
SQLiteCommand () | |
コンストラクタ | |
SQLiteCommand (SQLiteConnection connect) | |
コンストラクタ | |
void | Cancel () |
キャンセル ※全体に影響する | |
void | Prepare () |
コマンド予約 SQLコマンドを準備する為に、設定されたパラメータをバインドパラメータにセットします。 | |
IDataReader | ExecuteReader (CommandBehavior behavior) |
読込みSQL実行 コマンド予約していない場合、コマンド予約を行う。 実行完了後、パラメータをリセットします。 ※未サポート | |
object | ExecuteScalar () |
単一行結果用SQL実行 コマンド予約していない場合、コマンド予約を行う。 実行完了後、パラメータをリセットします。 | |
int | ExecuteNonQuery () |
SQL実行 コマンド予約を行います。 実行完了後、パラメータをリセットします。. | |
IDbDataParameter | CreateParameter () |
パラメータ作成 | |
new void | Dispose () |
デストラクタ | |
object | Clone () |
Protected メソッド | |
void | bindparams (OSQLiteStmtWrap stmt) |
パラメータをバインドする | |
Protected 変数 | |
SQLiteConnection | m_connect = null |
SQLite接続. | |
SQLiteTransaction | m_transaction = null |
SQLiteトランザクション. | |
SQLiteParameterCollection | m_collection = new SQLiteParameterCollection() |
パラメータリスト | |
string | m_command = "" |
SQLテキスト. | |
OSQLiteStmtWrap | m_stmt = null |
コマンド予約 | |
bool | m_prepare = false |
予約完了 | |
CommandType | m_cmdtype = CommandType.Text |
コマンドタイプ | |
UpdateRowSource | m_urs = UpdateRowSource.None |
更新行の結果に対する適用方法 | |
プロパティ | |
System.Data.CommandType | CommandType [get, set] |
コマンドタイププロパティ ※未サポート | |
int | CommandTimeout [get, set] |
タイムアウトプロパティ ※未サポート | |
IDbConnection | Connection [get, set] |
接続プロパティ | |
UpdateRowSource | UpdatedRowSource [get, set] |
更新行の結果に対する適用方法プロパティ ※未サポート | |
string | CommandText [get, set] |
SQLコマンド. | |
IDataParameterCollection | Parameters [get] |
パラメータリストプロパティ | |
IDbTransaction | Transaction [get, set] |
トランザクションプロパティ |
SQLiteコマンド.
SQLiteCommand.cs の 14 行で定義されています。
SQLiteCSLib.SQLiteCommand.SQLiteCommand | ( | ) |
SQLiteCSLib.SQLiteCommand.SQLiteCommand | ( | SQLiteConnection | connect | ) |
コンストラクタ
connect | SQLite接続 |
SQLiteCommand.cs の 57 行で定義されています。
00058 { 00059 m_connect = connect; 00060 }
void SQLiteCSLib.SQLiteCommand.bindparams | ( | OSQLiteStmtWrap | stmt | ) | [protected] |
パラメータをバインドする
stmt | STMTラッパー |
SQLiteCommand.cs の 97 行で定義されています。
00098 { 00099 int iCnt = 1; 00100 00101 ArrayList paramlist = new ArrayList( Parameters ); 00102 paramlist.Sort(); 00103 00104 stmt.Reset(); 00105 00106 //バインド変数セット 00107 foreach( SQLiteParameter para in paramlist ) 00108 { 00109 //NULL値 00110 if( para.Value == null ) 00111 { 00112 stmt.bindNull( iCnt ); 00113 } 00114 else 00115 if( para.DbType == DbType.String ) 00116 { 00117 stmt.bindText( iCnt, (string)para.Value ); 00118 } 00119 else 00120 if( para.DbType == DbType.Int64 ) 00121 { 00122 stmt.bindInt64( iCnt, (long)para.Value ); 00123 } 00124 else 00125 if( para.DbType == DbType.Int32 || para.DbType == DbType.Int16 ) 00126 { 00127 stmt.bindInt( iCnt, (int)para.Value ); 00128 } 00129 else 00130 if( para.DbType == DbType.Boolean ) 00131 { 00132 stmt.bindBool( iCnt, (bool)para.Value ); 00133 } 00134 else 00135 if( para.DbType == DbType.Double ) 00136 { 00137 stmt.bindDouble( iCnt, (double)para.Value ); 00138 } 00139 else 00140 if( para.DbType == DbType.Decimal ) 00141 { 00142 stmt.bindDecimal( iCnt, (decimal)para.Value ); 00143 } 00144 else 00145 if( para.DbType == DbType.Binary ) 00146 { 00147 byte[] bindbin = (byte[])para.Value; 00148 stmt.bindBlob( iCnt, new MemoryStream( bindbin ) ); 00149 } 00150 00151 iCnt++; 00152 } 00153 }
void SQLiteCSLib.SQLiteCommand.Cancel | ( | ) |
キャンセル ※全体に影響する
SQLiteCommand.cs の 66 行で定義されています。
00067 { 00068 m_connect.OSQLiteDB.Interrupt(); 00069 }
IDbDataParameter SQLiteCSLib.SQLiteCommand.CreateParameter | ( | ) |
new void SQLiteCSLib.SQLiteCommand.Dispose | ( | ) |
int SQLiteCSLib.SQLiteCommand.ExecuteNonQuery | ( | ) |
SQL実行 コマンド予約を行います。 実行完了後、パラメータをリセットします。.
SQLiteCommand.cs の 248 行で定義されています。
00249 { 00250 using( OSQLiteStmtWrap stmt = m_connect.OSQLiteDB.CreateStmt() ) 00251 { 00252 if( stmt.Prepate( m_command ) == false ) 00253 { 00254 if( m_connect.OSQLiteDB.getLastErr() != ResultEnum.DONE && 00255 m_connect.OSQLiteDB.getLastErr() != ResultEnum.ROW && 00256 m_connect.OSQLiteDB.getLastErr() != ResultEnum.OK ) 00257 { 00258 //エラー発生 00259 throw new SQLiteException( m_connect ); 00260 } 00261 00262 return 0; 00263 } 00264 00265 //パラメータバインド 00266 bindparams( stmt ); 00267 00268 m_stmt = null; 00269 m_prepare = false; 00270 m_collection = new SQLiteParameterCollection(); 00271 00272 //結果セットをカウント 00273 int iCnt=0; 00274 while( stmt.Step() == ResultEnum.ROW ) iCnt++; 00275 00276 return iCnt; 00277 } 00278 }
IDataReader SQLiteCSLib.SQLiteCommand.ExecuteReader | ( | CommandBehavior | behavior | ) |
読込みSQL実行 コマンド予約していない場合、コマンド予約を行う。 実行完了後、パラメータをリセットします。 ※未サポート
behavior | データベースに与える影響 |
SQLiteCommand.cs の 184 行で定義されています。
00185 { 00186 if( m_prepare == false ) 00187 { 00188 Prepare(); 00189 } 00190 00191 if( m_prepare == false ) 00192 { 00193 //失敗 00194 throw new SQLiteException( m_connect ); 00195 } 00196 00197 OSQLiteStmtWrap stmt = m_stmt; 00198 m_stmt = null; 00199 00200 m_prepare = false; 00201 00202 m_collection = new SQLiteParameterCollection(); 00203 00204 return new SQLiteDataReader( stmt ); 00205 }
object SQLiteCSLib.SQLiteCommand.ExecuteScalar | ( | ) |
単一行結果用SQL実行 コマンド予約していない場合、コマンド予約を行う。 実行完了後、パラメータをリセットします。
SQLiteCommand.cs の 224 行で定義されています。
00225 { 00226 using ( IDataReader ir = ExecuteReader( CommandBehavior.Default ) ) 00227 { 00228 ir.Read(); 00229 00230 if( m_connect.OSQLiteDB.getLastErr() != ResultEnum.DONE && 00231 m_connect.OSQLiteDB.getLastErr() != ResultEnum.ROW && 00232 m_connect.OSQLiteDB.getLastErr() != ResultEnum.OK ) 00233 { 00234 //エラー発生 00235 throw new SQLiteException( m_connect ); 00236 } 00237 00238 return ir.GetValue(0); 00239 } 00240 }
void SQLiteCSLib.SQLiteCommand.Prepare | ( | ) |
コマンド予約 SQLコマンドを準備する為に、設定されたパラメータをバインドパラメータにセットします。
SQLiteCommand.cs の 75 行で定義されています。
00076 { 00077 m_stmt = m_connect.OSQLiteDB.CreateStmt(); 00078 00079 m_prepare = m_stmt.Prepate( m_command ); 00080 00081 //パラメータバインド 00082 bindparams( m_stmt ); 00083 00084 if( m_connect.OSQLiteDB.getLastErr() != ResultEnum.DONE && 00085 m_connect.OSQLiteDB.getLastErr() != ResultEnum.ROW && 00086 m_connect.OSQLiteDB.getLastErr() != ResultEnum.OK ) 00087 { 00088 //エラー発生 00089 throw new SQLiteException( m_connect ); 00090 } 00091 }
CommandType SQLiteCSLib.SQLiteCommand.m_cmdtype = CommandType.Text [protected] |
コマンドタイプ
SQLiteCommand.cs の 158 行で定義されています。
SQLiteParameterCollection SQLiteCSLib.SQLiteCommand.m_collection = new SQLiteParameterCollection() [protected] |
パラメータリスト
SQLiteCommand.cs の 29 行で定義されています。
string SQLiteCSLib.SQLiteCommand.m_command = "" [protected] |
SQLテキスト.
SQLiteCommand.cs の 34 行で定義されています。
SQLiteConnection SQLiteCSLib.SQLiteCommand.m_connect = null [protected] |
SQLite接続.
SQLiteCommand.cs の 19 行で定義されています。
bool SQLiteCSLib.SQLiteCommand.m_prepare = false [protected] |
予約完了
SQLiteCommand.cs の 44 行で定義されています。
OSQLiteStmtWrap SQLiteCSLib.SQLiteCommand.m_stmt = null [protected] |
コマンド予約
SQLiteCommand.cs の 39 行で定義されています。
SQLiteTransaction SQLiteCSLib.SQLiteCommand.m_transaction = null [protected] |
SQLiteトランザクション.
SQLiteCommand.cs の 24 行で定義されています。
UpdateRowSource SQLiteCSLib.SQLiteCommand.m_urs = UpdateRowSource.None [protected] |
更新行の結果に対する適用方法
SQLiteCommand.cs の 322 行で定義されています。
string SQLiteCSLib.SQLiteCommand.CommandText [get, set] |
SQLコマンド.
SQLiteCommand.cs の 344 行で定義されています。
int SQLiteCSLib.SQLiteCommand.CommandTimeout [get, set] |
タイムアウトプロパティ ※未サポート
SQLiteCommand.cs の 285 行で定義されています。
System.Data.CommandType SQLiteCSLib.SQLiteCommand.CommandType [get, set] |
コマンドタイププロパティ ※未サポート
SQLiteCommand.cs の 165 行で定義されています。
IDbConnection SQLiteCSLib.SQLiteCommand.Connection [get, set] |
接続プロパティ
SQLiteCommand.cs の 308 行で定義されています。
IDataParameterCollection SQLiteCSLib.SQLiteCommand.Parameters [get] |
パラメータリストプロパティ
SQLiteCommand.cs の 359 行で定義されています。
IDbTransaction SQLiteCSLib.SQLiteCommand.Transaction [get, set] |
トランザクションプロパティ
SQLiteCommand.cs の 370 行で定義されています。
UpdateRowSource SQLiteCSLib.SQLiteCommand.UpdatedRowSource [get, set] |
更新行の結果に対する適用方法プロパティ ※未サポート
SQLiteCommand.cs の 329 行で定義されています。