oracle已经成为我们公司所有程序员共同呕吐的对象了(经由我和另一个人{崇尚微软的牛XFans}发起
)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
1![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
old#region old
2
OracleParameter[] parms = null;
3![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
parms = new OracleParameter[]
{
5
new OracleParameter(":p_WZBH",OracleType.VarChar,23),
6
new OracleParameter(":p_JDSLB",OracleType.Char,1),
7
new OracleParameter(":p_JDSBH",OracleType.VarChar,10),
8
new OracleParameter(":p_JSZH",OracleType.VarChar,18),
9
new OracleParameter(":p_DABH",OracleType.VarChar,12),
10
new OracleParameter(":p_FZJG",OracleType.VarChar,10),
11
new OracleParameter(":p_XM",OracleType.VarChar,30),
12
new OracleParameter(":p_XZQH",OracleType.VarChar,10),
13
new OracleParameter(":p_XXDZ",OracleType.VarChar,128),
14
new OracleParameter(":p_DH",OracleType.VarChar,50),
15
new OracleParameter(":p_LXFS",OracleType.VarChar,128),
16
new OracleParameter(":p_JDCSYR",OracleType.VarChar,128),
17
new OracleParameter(":p_HPZL",OracleType.VarChar,2),
18
new OracleParameter(":p_HPHM",OracleType.VarChar,15),
19
new OracleParameter(":p_JTFS",OracleType.VarChar,3),
20
new OracleParameter(":p_WZSJ",OracleType.DateTime),
21
new OracleParameter(":p_WZDD",OracleType.VarChar,12),
22
new OracleParameter(":p_WFDZ",OracleType.VarChar,128),
23
new OracleParameter(":p_WZXW",OracleType.VarChar,4),
24
new OracleParameter(":p_ZQMJ",OracleType.VarChar,30),
25
new OracleParameter(":p_WZJFS",OracleType.Number),
26
new OracleParameter(":p_FKJE",OracleType.Number),
27
new OracleParameter(":p_ZNJ",OracleType.Number),
28
new OracleParameter(":p_JKFS",OracleType.Char,1),
29
new OracleParameter(":p_FXJG",OracleType.VarChar,10),
30
new OracleParameter(":p_CLJG",OracleType.VarChar,10),
31
new OracleParameter(":p_CFZL",OracleType.VarChar,4),
32
new OracleParameter(":p_CLSJ",OracleType.DateTime),
33
new OracleParameter(":p_CLBJ",OracleType.Char,1),
34
new OracleParameter(":p_LRR",OracleType.VarChar,30),
35
new OracleParameter(":p_JSJQBJ",OracleType.Char,2),
36
new OracleParameter(":p_PPBJ",OracleType.Char,1),
37
new OracleParameter(":p_JYW",OracleType.VarChar,128),
38
new OracleParameter(":p_JBR1",OracleType.VarChar,30),
39
new OracleParameter(":p_JBR2",OracleType.VarChar,30),
40
};
41![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
42
parms[0].Value = wfbh;
43
parms[1].Value = jdslb;
44
parms[2].Value = jdsbh;
45
parms[3].Value = jszh;
46
parms[4].Value = dabh;
47
parms[5].Value = fzjg;
48
parms[6].Value = xm;
49
parms[7].Value = xzqh;
50
parms[8].Value = xxdz;
51
parms[9].Value = dh;
52
parms[10].Value = lxfs;
53
parms[11].Value = jdcsyr;
54
parms[12].Value = hpzl;
55
parms[13].Value = hphm;
56
parms[14].Value = jtfs;
57
parms[15].Value = Convert.ToDateTime(wfsj); //wfsj;
58
parms[16].Value = wfdd;
59
parms[17].Value = wfdz;
60
parms[18].Value = wfxw;
61
parms[19].Value = zqmj;
62
parms[20].Value = Convert.ToInt32(wfjfs);
63
parms[21].Value = Convert.ToInt32(fkje);
64
parms[22].Value = Convert.ToInt32(znj);
65
parms[23].Value = jkfs;
66
parms[24].Value = fxjg;
67
parms[25].Value = cljg;
68
parms[26].Value = cfzl;
69
parms[27].Value = Convert.ToDateTime(clsj);
70
parms[28].Value = clbj;
71
parms[29].Value = lrr;
72
parms[30].Value = jsjqbj;
73
parms[31].Value = ppbj;
74
parms[32].Value = jyw;
75
parms[33].Value = jbr1;
76
parms[34].Value = jbr2;
77
#endregion
第一种方法
编译无错,但是报异常,乱糟糟一堆甲骨文....![](https://www.cnblogs.com/Emoticons/baimantou/21522581.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
1
OracleCommand sqlCmd = new OracleCommand(TSQL_PROC_INSERTVIOLATION, oc);
2
sqlCmd.CommandType = CommandType.StoredProcedure;
3
oc.Open();
4
if (oc.State == ConnectionState.Open)
5![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
6![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
sqlCmd.Parameters.Add("p_WFBH", OracleType.VarChar, 22).Value = wfbh;
8
sqlCmd.Parameters.Add("p_JDSLB", OracleType.Char, 1).Value = jdslb;
9
sqlCmd.Parameters.Add("p_JDSBH", OracleType.VarChar, 10).Value = jdsbh;
10
sqlCmd.Parameters.Add("p_JSZH", OracleType.VarChar, 18).Value = jszh;
11
sqlCmd.Parameters.Add("p_DABH", OracleType.VarChar, 12).Value = dabh;
12
sqlCmd.Parameters.Add("p_FZJG", OracleType.VarChar, 10).Value = fzjg;
13
sqlCmd.Parameters.Add("p_XM", OracleType.VarChar, 30).Value = xm;
14
sqlCmd.Parameters.Add("p_XZQH", OracleType.VarChar, 10).Value = xzqh;
15
sqlCmd.Parameters.Add("p_XXDZ", OracleType.VarChar, 128).Value = xxdz;
16
sqlCmd.Parameters.Add("p_DH", OracleType.VarChar, 50).Value = dh;
17
sqlCmd.Parameters.Add("p_LXFS", OracleType.VarChar, 128).Value = lxfs;
18
sqlCmd.Parameters.Add("p_JDCSYR", OracleType.VarChar, 128).Value = jdcsyr;
19
sqlCmd.Parameters.Add("p_HPZL", OracleType.VarChar, 2).Value = hpzl;
20
sqlCmd.Parameters.Add("p_HPHM", OracleType.VarChar, 15).Value = hphm;
21
sqlCmd.Parameters.Add("p_JTFS", OracleType.VarChar, 3).Value = jtfs;
22
sqlCmd.Parameters.Add("p_WFSJ", OracleType.DateTime).Value = Convert.ToDateTime(wfsj);
23
sqlCmd.Parameters.Add("p_WFDD", OracleType.VarChar, 12).Value = wfdd;
24
sqlCmd.Parameters.Add("p_WFDZ", OracleType.VarChar, 128).Value = wfdz;
25
sqlCmd.Parameters.Add("p_WFXW", OracleType.VarChar, 4).Value = wfxw;
26
sqlCmd.Parameters.Add("p_ZQMJ", OracleType.VarChar, 30).Value = zqmj;
27
sqlCmd.Parameters.Add("p_WFJFS", OracleType.Number).Value = Convert.ToInt32(wfjfs);
28
sqlCmd.Parameters.Add("p_FKJE", OracleType.Number).Value = Convert.ToInt32(fkje);
29
sqlCmd.Parameters.Add("p_ZNJ", OracleType.Number).Value = Convert.ToInt32(znj);
30
sqlCmd.Parameters.Add("p_JKFS", OracleType.Char, 1).Value = jkfs;
31
sqlCmd.Parameters.Add("p_FXJG", OracleType.VarChar, 10).Value = fxjg;
32
sqlCmd.Parameters.Add("p_CLJG", OracleType.VarChar, 10).Value = cljg;
33
sqlCmd.Parameters.Add("p_CFZL", OracleType.VarChar, 4).Value = cfzl;
34
sqlCmd.Parameters.Add("p_CLSJ", OracleType.DateTime).Value = Convert.ToDateTime(clsj);
35
sqlCmd.Parameters.Add("p_CLBJ", OracleType.Char, 1).Value = clbj;
36
sqlCmd.Parameters.Add("p_LRR", OracleType.VarChar, 30).Value = lrr;
37
sqlCmd.Parameters.Add("p_JSJQBJ", OracleType.Char, 2).Value = jsjqbj;
38
sqlCmd.Parameters.Add("p_PPBJ", OracleType.Char, 1).Value = ppbj;
39
sqlCmd.Parameters.Add("p_JYW", OracleType.VarChar, 128).Value = jyw;
40
sqlCmd.Parameters.Add("p_JBR1", OracleType.VarChar, 30).Value = jbr1;
41
sqlCmd.Parameters.Add("p_JBR2", OracleType.VarChar, 30).Value = jbr2;
42
}
第二种方法竟然神奇般的通过了,,,后来我跑到角落骂娘了![](https://www.cnblogs.com/Emoticons/baimantou/103828514.gif)
此问题困扰了我这个猛男一上午的时间,哎,郁闷,,,已经把做oracle和推荐用oracle的人诅咒个遍了![](https://www.cnblogs.com/Emoticons/baimantou/223332943.gif)
希望各位遇到各种oracle的问题的难友们别藏着窝着了,让我们在这里一起发泄一下吧!!!![](https://www.cnblogs.com/Emoticons/baimantou/202015934.gif)