質問編集履歴
3
編集
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
string DataSource ="oracleのPASS"
|
10
10
|
|
11
|
-
string sql= "select * from SampleTable where date>=
|
11
|
+
string sql= "select * from SampleTable where date>=startDate";
|
12
12
|
|
13
13
|
using(OracleConnection conn = new OracleConnection(DataSource))
|
14
14
|
|
@@ -19,6 +19,32 @@
|
|
19
19
|
using(OracleCommand cmd=new OracleCommand(sql,conn)
|
20
20
|
|
21
21
|
{
|
22
|
+
|
23
|
+
//パラメータの作成
|
24
|
+
|
25
|
+
OracleParameter parameterS = new OracleParameter();
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
//パラメータ名はコロンを除いた名前を指定します。
|
30
|
+
|
31
|
+
parameterS.ParameterName = "StartDate";
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
//パラメータの値を設定します。
|
36
|
+
|
37
|
+
parameterS.Value = StartDate;
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
//パラメータをコマンドに追加します。
|
42
|
+
|
43
|
+
cmd.Parameters.Add(parameterS);
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
22
48
|
|
23
49
|
using(OracleDataReader read=cmd.ExecuteReader())
|
24
50
|
|
2
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
conn.Open();
|
18
18
|
|
19
|
-
using(OracleComand cmd=new OracleComand(sql,conn)
|
19
|
+
using(OracleCommand cmd=new OracleCommand(sql,conn)
|
20
20
|
|
21
21
|
{
|
22
22
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
string DataSource ="oracleのPASS"
|
10
10
|
|
11
|
-
string sql= select * from SampleTable where date>='20201120'
|
11
|
+
string sql= "select * from SampleTable where date>='20201120'";
|
12
12
|
|
13
13
|
using(OracleConnection conn = new OracleConnection(DataSource))
|
14
14
|
|