|
-
Oct 26th, 2006, 04:04 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] help with transfer database
hi guys! currently i have MS SQL server 2005 as my back-end/database but im planning to transfer from MS SQL 2005 to Oracle 10g. Can i have some advice on what to consider when changing database. Do I just need to change my connection string?
my current connection method:
Code:
SqlConnStr = @"Data Source = " + txtSettingsDatasource.Text + "; Initial Catalog=" + txtSettingsDatabase.Text +
"; User ID=" + txtSettingsLogin.Text + "; " + "Password=" + RndCrypt(txtSettingsPassword.Text, default_key);
public bool db_connection()
{
try
{
sqlConn = new SqlConnection(SqlConnStr);
sqlConn.Open();
return true;
}
catch (System.Data.SqlClient.SqlException ex)
{
//MessageBox.Show("DB CONNECTION ERROR: " + ex.Message + "\r\nPlease contact your administrator.","BCMD",MessageBoxButtons.OK,MessageBoxIcon.Error);
show_error_message("db_connection", ex.Message);
return false;
}
}
-
Oct 26th, 2006, 04:14 AM
#2
Re: help with transfer database
You need to change all your data access objects. They will all be equivalent but Oracle requires OracleClient rather than SqlClient, which is SQL Server-specific. You may need to change some of your SQL code slightly too. If you aren't aware, Oracle offer a free junior burger version too. You can use it and distribute it just as you can SQL Server Express, so if you are planning to use Oracle as a back-end in production then that's a good development option.
-
Oct 26th, 2006, 04:39 AM
#3
Thread Starter
Fanatic Member
Re: help with transfer database
ohh...hope it will not be too hard for me...anyway, can I use the Oledb or Odbc or is there something better than those? btw, thanks for the input.
-
Oct 26th, 2006, 05:13 AM
#4
Re: help with transfer database
It's always best to use the most specific data connector you can. You could use OleDb or OdbcClient to connect to SQL Server and then just change the connection string to connect to Oracle, but you won't be getting the best performance in either case. SqlClient is best for SQL Server and OracleClient is best for Oracle.
-
Oct 26th, 2006, 05:53 AM
#5
Thread Starter
Fanatic Member
Re: help with transfer database
oh i see..maybe i'll just try to use the OracleClient since OracleClient is design to work with Oracle...Thanks for the inputs..
-
Oct 29th, 2006, 11:33 PM
#6
Thread Starter
Fanatic Member
Re: help with transfer database
hello! I've install Oracle Client 9i in my Computer where i develop my C#.net Windows application hoping to have the OracleClient Data connector but its not there..Is there something i missed? or installing Oracle Client 9i is not the way for me to get the OracleClient? any help please.
-
Oct 30th, 2006, 12:10 AM
#7
Re: help with transfer database
System.Data.OracleClient is a standard part of the .NET Framework and has nothing to do with Oracle itself. In .NET 1.x the members of the OracleClient namespace were declared in the System.Data.dll assembly, to which most projects have a reference by default. Because OracleClient is used considerably less that SqlClient, OleDb or OdbcClient it has been moved to its own assembly in .NET 2.0, so to access its members in a .NET 2.0 app you must reference the System.Data.OracleClient.dll assembly.
If you want to know what namespace and/or assembly a type is declared in simply go to the MSDN library and look up its help topic. Both are provided at the very top of each class overview topic.
-
Nov 2nd, 2006, 02:28 AM
#8
Thread Starter
Fanatic Member
Re: help with transfer database
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|