C# Á¬½ÓOracleÊý¾Ý¿â
C#Á¬½ÓOracleÊý¾Ý¿â×Ö·û´®
http://developer.51cto.com
2009-08-20 17:55 ØýÃû °Ù¶È¿Õ¼ä ÎÒÒªÆÀÂÛ(
0
)
C#Á¬½ÓOracleÊý¾Ý¿âÒÔ¼°C#Á¬½ÓOracleÊý¾Ý¿â×Ö·û´®µÈÄÚÈݽ«ÔÚ±¾ÎÄÖÐÕ¹ÏÖ£¬Ï£Íû±¾ÎÄÄܶԴó¼ÒÁ˽âC#Á¬½ÓÊý¾Ý¿âÓÐËù°ïÖú¡£
C#Á¬½ÓOracleÊý¾Ý¿â×Ö·û´®£¨²éѯÊý¾Ý£©
using
System;
using
System.Collections.Generic;
using
System.ComponentModel
using
System.Data.OracleClient;;
//ÕâÐкÍÏÂÒ»Ðж¼ÒªÏÈÔÚÒýÓÃÖÐÌî¼Ósystem.data.oracleclient
using
System.Data;
using
System.Drawing;
using
System.Text;
using
System.Windows.Forms;
namespace
WindowsApplication1
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
button1_Click(
object
sender, EventArgs e)
{
#region ´Óregionµ½endregionÊÇÊÖ¹¤Ð´µÄ¡£±ðµÄ¶¼ÊÇϵͳ×Ô¶¯Éú³ÉµÄ
string
constring =
"data source=wzd;user=wzd;password=wzd;"
;
//¶¨ÒåÁ¬½ÓÊý¾Ý¿âµÄ×Ö·û´®
OracleConnection conn =
new
OracleConnection(constring);
//½øÐÐÁ¬½Ó
&
Ïà¹ØÎĵµ£º
SQLÊÇÓÃÓÚ·ÃÎÊORACLEÊý¾Ý¿âµÄÓïÑÔ£¬PL/SQLÀ©Õ¹ºÍ¼ÓÇ¿ÁËSQLµÄ¹¦ÄÜ£¬Ëü ͬʱÒýÈëÁ˸üÇ¿µÄ³ÌÐòÂß¼¡£ PL/SQLÖ§³ÖDMLÃüÁîºÍSQLµÄÊÂÎñ¿ØÖÆÓï¾ä¡£DDLÔÚPL/SQLÖв»±»Ö§³Ö£¬Õâ¾ÍÒâζ×÷ÔÚPL/SQL³ÌÐò¿éÖв»ÄÜ´´½¨±í»òÆäËûÈκζÔÏ󡣽Ϻà µÄPL/SQL³ÌÐòÉè¼ÆÊÇÔÚPL/SQL¿éÖÐʹÓÃÏóDBMS_SQLÕâÑùµÄÄÚ½¨°ü»òÖ´ÐÐEXECUTE IMMEDIATEÃüÁÁ¢¶¯Ì ......
½éÉÜto_char(Êý×Ö, ‘¸ñʽ’)£¬±È½Ï³£Óõĸñʽ
9 ±íʾÓÐЧλÊý
0 ÓÃ0²¹×ãλÊý
B Óÿոñ²¹×ãλÊý
ÔÊýµÄλÖÃÓÐʵ¼ÊÊý×ÖռλµÄʱºò£¬0ºÍ9µÄЧ¹ûÊÇÒ»ÑùµÄ¡£
0ºÍ9µÄÇø±ðÔÚÓÚ¸ñʽÖеÄÄÇһλÖÃʵ¼ÊÊý×ÖûÓÐվλµÄÇé¿öÏ¡£
select to_char(0.45,'0.99'); ½á¹ûÊÇ0.45
select ......
ORACLEÈÏÖ¤Åàѵ³£¼ûÎÊÌâ
1¡¢ÎÊ£ºÊ²Ã´ÊÇ Oracle ÈÏÖ¤£¿¶¼ÓÐÄÄЩÖÖÀࣿ
¡¡¡¡´ð£ºOracle ÈÏÖ¤ÊÇÓÉOracle¹«Ë¾°ä²¼²¢ÊµÊ©µÄÒ»ÏîÈ¨Í ......
н¨Ò»¸öרÃÅÓÃÀ´´´½¨ÑéÖ¤ÂëͼƬµÄÒ³ÃæValidateCode.aspx
ËüµÄºǫ́csÎļþ´úÂëÈçÏ£º
PageLoad
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
private void Page_Load(object sender, System.EventArgs e)
{
string checkCode = CreateRandomCode(4);
Session["CheckCode"] = checkCode;
CreateImage(checkCode);
}
ÆäÖÐCreateRand ......
1.¿Í»§¶ËÁ¬½ÓÖÁoralce:
Ê×ÏÈ¿Í»§¶ËÁ¬½ÓÖÁoracleµÄ¼àÌýÆ÷,È»ºó¼àÌýÆ÷·ÖÅäÒ»¸öÊý¾Ý¿âʵÀý(ÕâÀïµÄÊÇʵÀý)¸ø¿Í»§¶Ë,È»ºó¿Í»§¶ËÒÔºó¾ÍÖ±½ÓÓëÕâ¸öÊý¾Ý¿âʵÀý½øÐÐÁ¬½Ó,Ö±ÖÁ¶Ï¿ªÓëoracleµÄÁ¬½Ó.
2.Ìá½»sql:
(1)¿Í»§¶ËÓû§Ìá½»Ò»¸ösql ......