如何将.net应用程序与oracle数据库连接,并将mssql db导出到oracle [英] How to connect .net application with oracle database and also export mssql db to oracle

查看:62
本文介绍了如何将.net应用程序与oracle数据库连接,并将mssql db导出到oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用mssql数据库创建了一个vb表单应用程序(.net 4)。我有一些存储过程用于插入更新和从表中删除数据。





i需要解决方案



1)将所有表从Microsoft SQL(MSSQL)2008 R2导出到oracle 11g。

2)如何将我的vb应用程序连接到oracle 11g ?只是改变连接就够了吗?



i已经在我的系统中安装了oracle 11g

i have created an vb form application (.net 4) with mssql database. i have some stored procedures in that which is been used for inserting updating and removing data from tables.


i need solution for

1) Export all tables from Microsoft SQL (MSSQL) 2008 R2 to oracle 11g.
2) How can i connect my vb application to oracle 11g ? is just change in connection is enough ??

i have installed oracle 11g in my system

推荐答案

1 。要将所有表从MSSQL 2008导出到Oracle 11G,您可以在MSSQL中使用SQL Server Management Studio生成用于创建所有数据库结构(表,FK,SP等)的SQL命令并将其保存到文件中,然后验证这个SQLs命令,可能需要进行一些ORACLE兼容的小改动,最后在Oracle上运行它们。



关于表中的数据,你应该创建一个小程序,连接数据库和从MSSQL表读取数据,并将它们保存到Oracle的类似表中。 br />


2.必须修改连接字符串,你还必须使用ORACLE的ADO.NET程序集,如System.Data.OracleClient.dll
1. To Export all tables from MSSQL 2008 to Oracle 11G, you could generate in MSSQL, by using SQL Server Management Studio, the SQL commands for creating all database structure (tables, FKs, SP, etc) and save it into a file, then validate this SQLs command, maybe with some little changes to be ORACLE compatible, and finally run them on Oracle.

Regarding the data from the table you should create a small program that connect with both database and read data from MSSQL tables and save them into the similar table from Oracle.

2.The connection string have to be modified, and you have to use also the ADO.NET assemblies for ORACLE like System.Data.OracleClient.dll


你好Sidharth,



我建议你看看这篇OTN文章 [ ^ ]。它提供了使用Oracle提供的SQL Developer工具将SQL Server数据库迁移到Oracle的分步说明。这是一个基于Java的工具&需要Java Runtime。



现在第二部分我建议你下载 ODP.NET [ ^ ],再次来自OTN网站&使用那些DB驱动程序。如劳尔所提到的,这需要更改你的申请。



问候,
Hello Sidharth,

I will suggest you have a look at this OTN article[^]. It provides step by step instruction in migrating SQL Server database to Oracle using a Oracle provided tool called SQL Developer. This a Java based tool & will require a Java Runtime.

Now for the second part I will suggest you to download ODP.NET[^], again from OTN web site & use those DB drivers. Ofcourse as mentioned by Raul this will require a change in your application.

Regards,


谢谢你的帮助.. 。



一切都很好,期待这个错误信息





查看有关调用

实时(JIT)调试而非此对话框的详细信息,请参阅此消息的结尾。



*** ***********异常文本**************

System.TypeInitializationException:'Oracle.DataAccess.Client的类型初始值设定项。 OracleConnection'引发了异常。 ---> Oracle.DataAccess.Client.OracleException:提供程序与Oracle客户端的版本不兼容

在Oracle的Oracle.DataAccess.Client.OracleInit.Initialize()

。 DataAccess.Client.OracleConnection..cctor()

---内部异常堆栈跟踪结束---

at Oracle.DataAccess.Client.OracleConnection..ctor(字符串connectionString)

在WindowsApplication4.Form1.Button1_Click(对象发件人,EventArgs e)中的D:\ Oracle \ WindowsApplication4 \ .Form1.vb:第18行
at System.Windows.Forms.Control.OnClick(EventArgs e)

在System.Windows.Forms.Button.OnClick(EventArgs e)

在System.Windows.Forms。 Button.OnMouseUp(MouseEventArgs mevent)

在System.Windows.Forms.Control.WmMouseUp(消息& m,MouseButtons按钮,Int32点击)

在System.Windows.Forms .Control.WndProc(Message& m)

在System.Windows.Forms.ButtonBase.WndProc(Message& m)(消息& m)

在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(消息& m)

在System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

在System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)





**************已装载的装配**************

mscorlib

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/ Windows /Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

---------------------------- ------------

WindowsApplication4

汇编版本:1.0.0.0

Win32版本:1.0.0.0

CodeBase:file:/// C:/Users/Administrator/Desktop/D/WindowsApplication4.exe

-------------- --------------------------

Microsoft.VisualBasic

汇编版本:10.0。 0.0

Win32 Ve rsion:10.0.30319.1建立者:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft .VisualBasic.dll

-------------------------------------- -

系统

汇编版本:4.0.0.0

Win32版本:4.0.30319.1建立者:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

-------- --------------------------------

System.Core

汇编版本:4.0.0.0

Win32版本:4.0.30319.1内置:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly /GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

---------------------- ------------------

System.Windows.Forms

汇编版本:4.0.0.0

Win32版本:4.0.30319.1建立者:RTMRel

Cod eBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

- ---------------------------------------

System.Drawing

汇编版本:4.0.0.0

Win32版本:4.0.30319.1内置:RTMRel

CodeBase:file:/// C:/ Windows / Microsoft.Net / assembly / GAC_MSIL / System.Drawing / v4.0_4.0.0.0__b03f5f7f11d50a3a / System.Drawing.dll

--------------- -------------------------

System.Configuration

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System .Configuration / v4.0_4.0.0.0__b03f5f7f11d50a3a / System.Configuration.dll

-------------------------- --------------

System.Xml

汇编版本:4.0.0.0

Win32版本: 4.0.30319.1建立者:RTMRel

CodeBase:文件:/ //C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

---------- ------------------------------

System.Runtime.Remoting

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/ Windows / Microsoft。 Net / assembly / GAC_MSIL / System.Runtime.Remoting / v4.0_4.0.0.0__b77a5c561934e089 / System.Runtime.Remoting.dll

--------------- -------------------------

System.Data

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_32/System .Data / v4.0_4.0.0.0__b77a5c561934e089 / System.Data.dll

-------------------------- --------------

System.Data.DataSetExtensions

汇编版本:4.0.0.0

Win32版本:4.0.30319.1内容:RTMRel

CodeBase:file:/// C:/ Windows /Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll

------------ ----------------------------

System.Numerics

汇编版本: 4.0.0.0

Win32版本:4.0.30319.1内容:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System .Numerics / v4.0_4.0.0.0__b77a5c561934e089 / System.Numerics.dll

-------------------------- --------------

Oracle.ManagedDataAccess

汇编版本:4.121.1.0

Win32版本: 4.121.1.0

CodeBase:file:/// C:/Users/Administrator/Desktop/D/Oracle.ManagedDataAccess.DLL

-------- --------------------------------

System.Transactions

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/ Windows / Microsoft。净/组装/ GAC_32 / System.Transactions中/ V4。 0_4.0.0.0__b77a5c561934e089 / System.Transactions.dll

------------------------------- ---------

System.Data.Entity

汇编版本:4.0.0.0

Win32版本:4.0.30319.1建立者:RTMRel

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Entity/v4.0_4.0.0.0__b77a5c561934e089/System.Data。 Entity.dll

--------------------------------------- -

System.EnterpriseServices

汇编版本:4.0.0.0

Win32版本:4.0.30319.1(RTMRel.030319-0100)

CodeBase:file:/// C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

----------------------------------------

甲骨文。 DataAccess

汇编版本:4.121.1.0

Win32版本:4.121.1.0 ODAC

CodeBase:file:/// C:/ Users /管理员/桌面/ D / Oracle.DataAccess.DLL

----------------------------------------



************** JIT调试**************

启用实时(JIT)调试,此

应用程序或计算机(machine.config)的.config文件必须在系统中设置

jitDebugging值。 windows.forms部分。

应用程序也必须使用调试编译

启用。



例如:



< configuration>

< system.windows.forms jitdebugging =true>





启用JIT调试后,任何未处理的异常

将被发送到计算机上注册的JIT调试器

而不是由此对话框处理。
Thank you for your help...

Everything is fine expect this error message


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
at Oracle.DataAccess.Client.OracleInit.Initialize()
at Oracle.DataAccess.Client.OracleConnection..cctor()
--- End of inner exception stack trace ---
at Oracle.DataAccess.Client.OracleConnection..ctor(String connectionString)
at WindowsApplication4.Form1.Button1_Click(Object sender, EventArgs e) in D:\Oracle\WindowsApplication4\Form1.vb:line 18
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsApplication4
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Administrator/Desktop/D/WindowsApplication4.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Data.DataSetExtensions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Oracle.ManagedDataAccess
Assembly Version: 4.121.1.0
Win32 Version: 4.121.1.0
CodeBase: file:///C:/Users/Administrator/Desktop/D/Oracle.ManagedDataAccess.DLL
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Data.Entity
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.Entity/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Entity.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
Oracle.DataAccess
Assembly Version: 4.121.1.0
Win32 Version: 4.121.1.0 ODAC
CodeBase: file:///C:/Users/Administrator/Desktop/D/Oracle.DataAccess.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitdebugging="true">


When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


这篇关于如何将.net应用程序与oracle数据库连接,并将mssql db导出到oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆