錯誤沒貼出來。 我只能猜測:
創新互聯是一家專業提供夾江企業網站建設,專注與網站制作、成都網站制作、HTML5建站、小程序制作等業務。10年已為夾江眾多企業、政府機構等服務。創新互聯專業網站設計公司優惠進行中。
string sql = "select * from t_users where USER=@USER and PASS=@PASS";
string[,] UserInfo = { { "@Uname", loginInfo.UName }, { "@UID", loginInfo.UPassword } };
改成
string sql = "select * from t_users where USER=:USER and PASS=:PASS";
string[,] UserInfo = { { "Uname", loginInfo.UName }, { "UID", loginInfo.UPassword } };
試試
這樣讀取:declare /*聲明PL/SQL中程序塊中的變量info_var,用戶存放查詢到的info列的數據,其類型必須和表中的字段類型一致*/ info_var clob; --查詢數據長度 amount integer; --偏移量,查詢起始位置 offset integer; --需要打印的字節,存儲變量 info_output varchar2(1000); begin --查詢要打印的字段信息并賦值給info_var select info into info_var from t_clob where id = 1; --查詢100長度 amount :=100; --從第一個開始 offset :=1; --用dbms_lob程序包讀取數據 dbms_lob.read(info_var,amount,offset,info_var); --用dbms_lob程序包打印讀取得數據info_var dbms_output.put_line(info_var); end; /
c#中怎么讀取oracle資料庫里的表? string connStr = "Provider=MSDAORA;Data Source=dbname;User ID=user_name;Password=sa;Unicode=True"; dbname是你的資料庫名 user_name是你的資料庫登陸名
sa是密碼
string sqlStr = "select * from baojing";
OleDbConnection oledbconn = new OleDbConnection(connStr); 新建個數據庫聯接
OleDbCommand oledb = new OleDbCommand(sqlStr, oledbconn);
oledbconn.Open();
OleDbDataAdapter adp = new OleDbDataAdapter(oledb);
DataSet ds1=new DataSet();
adp.Fill(ds1, "srctable");
/*
下一步就是new一個數據顯示空間,把datasource設為ds1
別忘了這個:using System.Data.OleDb;
*/
用C#讀取oracle資料庫資料 然后 插入到sqlserver資料庫中怎么實現
就分兩部走,先用oracle資料庫連線類讀取資料,然后在用sqlserver資料庫連線類插入資料就可以了。
C#讀取資料庫里的資訊
具體的需求不是很明確,請明確你的問題。
下面是C#資料庫操作,希望能給你提供些思路:
:blog.csdn./mynewdays/article/details/6780533。
如果不行的話在聯絡吧。
怎么刪除oracle資料庫里的表格
刪表就是drop命令。 如果你要大量刪除表,只保留其中幾張表,可以用exp命令將需要保留的表匯出,然后用sys使用者以DBA身份登入資料庫drop掉那個使用者,就可以把所有表都刪除。之后,再建立剛才drop的使用者,再將之前exp匯出的表imp導進剛才的使用者就可以了。
oracle資料庫里的資料怎么匯出
Oracle資料匯入匯出imp/exp
功能:Oracle資料匯入匯出imp/exp就相當與oracle資料還原與備份。
大多情況都可以用Oracle資料匯入匯出完成資料的備份和還原(不會造成資料的丟失)。
Oracle有個好處,雖然你的電腦不是伺服器,但是你裝了oracle客戶端,并建立了連線
(通過Net Configuration Assistant新增正確的服務命名,其實你可以想成是客戶端與伺服器端 修了條路,然后資料就可以被拉過來了)
這樣你可以把資料匯出到本地,雖然可能伺服器離你很遠。
你同樣可以把dmp檔案從本地匯入到遠處的資料庫伺服器中。
利用這個功能你可以構建倆個相同的資料庫,一個用來測試,一個用來正式使用。
執行環境:可以在SQLPLUS.EXE或者DOS(命令列)中執行,
DOS中可以執行時由于 在oracle 8i 中 安裝目錄\$ora10g\BIN被設定為全域性路徑,
該目錄下有EXP.EXE與IMP.EXE檔案被用來執行匯入匯出。
oracle用java編寫,我想SQLPLUS.EXE、EXP.EXE、IMP.EXE這倆個檔案是被包裝后的類檔案。
SQLPLUS.EXE呼叫EXP.EXE、IMP.EXE他們所包裹的類,完成匯入匯出功能。
下面介紹的是匯入匯出的例項,向導入匯出看例項基本上就可以完成,因為匯入匯出很簡單。
資料匯出:
1 將資料庫TEST完全匯出,使用者名稱system 密碼manager 匯出到D:\daochu.dmp中
exp system/manager@TEST file=d:\daochu.dmp full=y
2 將資料庫中system使用者與sys使用者的表匯出
exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
3 將資料庫中的表table1 、table2匯出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2)
4 將資料庫中的表table1中的欄位filed1以"00"打頭的資料匯出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"
上面是常用的匯出,對于壓縮我不太在意,用winzip把dmp檔案可以很好的壓縮。
不過在上面命令后面 加上 press=y 就可以了
資料的匯入
1 將D:\daochu.dmp 中的資料匯入 TEST資料庫中。
imp system/manager@TEST file=d:\daochu.dmp
上面可能有點問題,因為有的表已經存在,然后它就報錯,對該表就不進行匯入。
在后面加上 ignore=y 就可以了。
2 將d:\daochu.dmp中的表table1 匯入
imp system/manager@TEST file=d:\daochu.dmp tables=(table1)
基本上上面的匯入匯出夠用了。不少情況我是將表徹底刪除,然后匯入。
注意:
你要有足夠的許可權,許可權不夠它會提示你。
資料庫時可以連上的。可以用tnsping TEST 來獲得資料庫TEST能否連上。
資料匯出:
exp hkb/hkb@boss_14 full=y file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbfull.log;
匯出注意事項:匯出的是當前使用者的的資料,當前使用者如果有DBA的許可權,則匯出所有資料!
同名使用者之間的資料匯入:
imp hkb/hkb@xe file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbimp.log full=y
不同名之間的資料匯入:
imp system/test@xe fromuser=hkb touser=hkb_new file=c:\orabackup\hkbfull.dmp
log=c:\orabackup\hkbimp.log;
怎么清空oracle資料庫里表資料
兩種方式:
1、delete from 表名;
2、truncate table 表名;
1可以刪除全部資料,也可以根據條件刪除資料;
2只能刪除全部資料,比1速度要快。
怎么查詢oracle資料庫里的有資料的表
不準確的:
select table_name,num_rows from dba_tables where num_rows 0 ;
因為統計資訊不是實時的,所以可能不準確。
想要得到準確的資料,需要自己寫儲存過程,查詢每一個表中的資料量。
select count(*) from table_name where rownum2 ;
為0表示沒有資料,為1表示有資料。
c#怎么讀取aess資料庫資料
using (OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Data\db.mdb;Persist Security Info=False")) { conn.Open(); string sql = "SELECT Id,Name,Gender,Birthday,IdentityCode,HomeAddress,EmployeeId FROM tb_employee"; OleDbCommand cmd = new OleDbCommand(sql, conn); using (IDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { int Id = reader.GetInt32(0); string Name = reader.GetString(1); int Gender = reader.GetInt32(2); DateTime Birthday = reader.GetDateTime(3); string IdentityCode = reader.GetString(4); string HomeAddress = reader.GetString(5); string EmployeeId = reader.GetString(6); } } }
code *** ith 讀取oracle資料庫 表中的Description為什么讀取不到
string connectionString ="server=localhost";database=Northwind;uid="填你自己的使用者名稱";pwd="填你的資料庫的密碼";
如何用C#讀取ORACLE資料庫儲存的圖片
如果是把圖片位元組存在資料庫。
那么轉換為流就可以了。
byete[]myBytes=(byte[])dt.Rows[0]["Img"];
MemoryStream ms= new MemoryStream(myBytes);
Image img =Image.FromStream(ms):
當前標題:oracle中如何讀取 oracle如何讀取sql文件
當前路徑:http://www.yijiale78.com/article26/hpdccg.html
成都網站建設公司_創新互聯,為您提供定制網站、定制開發、手機網站建設、軟件開發、商城網站、品牌網站建設
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯