-
第三种:利用
OracleCommand
的<
/p>
CommandText
属性
OracleCommand myConnection =
new
OracleCommand();
tion = myConnection;
ction
= ransaction();
dText =
eNonQuery();
();
2.3
事务的操作。
Commit,rollback
//
连接数据库并打开
string
myConnString
=
”
Password=microsoft;Persist
Security
Info=false;User
ID=scott;
Data
Sou
rce=orcl
;
Integrated
Security=true
”
;
OracleConnection myConnection =
new
OracleConnection(myConnString);
();
{
//
创建事务
OracleTransaction myTransaction
= ransaction();
OracleCommand
myocmd =
new
OracleCommand(
ction =
myTransaction;
try
{
//
语句块
();
}
catch
(Exception ex)
{
(e);
ck();
}
finally
{
();
}
}
2.4
从数据表中读取图片数据
p>
从数据库中取一个图片数据,用
二进制数组来存储,然后将其显示在
指定
的控件上。
byte
[] tmpImage =
(
byte
[])curRow[
//
fileLength
是数组的长度(图片的大小)和
curI
mageFormat
图片格式。
fileLength =
MemoryStream
curStream =
new
MemoryStream(tmpImage);
=
ream(curStream);
curImageFormat = mat;
2.5
命令参数的创建和使用
创建命令参数
private
OracleParameter
CreateOraParam(
string
ParamName,
object
ParamValue)
{
OracleParameter Result =
new
OracleParameter();
terName =
ParamName;
if
(ParamValue !=
null
)
{
= ParamValue;
-
-
-
-
-
-
-
-
-
上一篇:人教版小学数学四年级下册【小数的意义和性质】知识点整理
下一篇:小数的定义