Results 1 to 8 of 8

Thread: [RESOLVED] help with transfer database

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Resolved [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;
                }
            }

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    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.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    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..

  6. #6

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    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.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  8. #8

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: help with transfer database

    thanks for that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width