LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by AKRRKA » Mon 01 Jul 2013 10:02

Hello,

How connect to the database schema as a different user?
For example to scheme NEWDB, with a user NEWUSER (with not the user NEWDB).
The user NEWDB is owner for schema NEWDB, and NEWUSER has the necessary privileges to connect and work with it.

How to correctly create a connection string???
In Entity Developer do not find such a setting in the connection dialog.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Tue 02 Jul 2013 09:37

Please select "Show All Objects" in the Database Explorer after you have opened the connection with a NEWUSER user. You will see all available schemas, select the necessary one and try expanding the Tables node. If NEWUSER has the necessary privileges to connect and work with this schema, all available objects will be shown.

Please tell us about the results.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by AKRRKA » Tue 02 Jul 2013 13:35

I need connect from my application use LinqConnect.
How to correctly create a connection string???
For example a parameter "database" or "schema" I need.
user id=newuser;database=newdatabase;password=*;server=10.5.56.177;home=xe;direct=True;sid=XE;persist security info=True

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Wed 03 Jul 2013 09:50

There is no such parameter in the Oracle connection string.
The steps to implement this scenario:
1) Select "Show All Objects" in the Database Explorer after you have opened the connection with a NEWUSER user in the Entity Developer.
2) Drag all the necessary database objects to your model.
3) Save changes.
4) If the mapping is generated with schema names (the "Preserve schema name in storage" check box is selected in the Model Settings), create a DataContext object with your connection string and perform queries to the necessary tables:

Code: Select all

connString = "User Id=NEWUSER ;Password=****;Server=ORCL1120;Home=oraclient11g_home2;Persist Security Info=True";
 Context.DataContext dt = new Context.DataContext(connString ) { Log = Console.Out };
 var q = (from c in dt.Status select c).ToList();
5) If the mapping is generated without schema names (the "Preserve schema name in storage" check box is not selected in the Model Settings), build your connection string in the following way:

Code: Select all

 OracleConnectionStringBuilder sb = new OracleConnectionStringBuilder();
            sb.InitializationCommand = "ALTER SESSION SET CURRENT_SCHEMA=NEWDB";
            sb.Server = "ORCL1120";
            sb.UserId="NEWUSER";
            sb.Password="****";
            sb.Home = "oraclient11g_home2";
            OracleConnection conn = new OracleConnection(sb.ConnectionString);          
            Context.DataContext dt = new Context.DataContext(conn) { Log = Console.Out };
            conn.Open();
            var q = (from c in dt.Status select c).ToList();
JIC: Status is related to NEWDB, not to NEWUSER.

Please pay attention to these articles
http://www.devart.com/dotconnect/oracle ... ction.html
http://www.devart.com/dotconnect/oracle ... ilder.html

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by AKRRKA » Wed 03 Jul 2013 13:06

Maybe you did not understand what I need.

Part 1
1) I am developing an application that works with different types of databases.
2) For these purposes, and bought LinqConnect.
3) I using one model for various types of databases. The connection string is generated dynamically depending on what the user enters, and what type of database type selected.
4) The sample project into this post. Please help with the formation of the connection string into this project.
5) To MySQL and SQL Server can connect to the same database on behalf of different users, and there meets both parameter in the connection string, and Oracle has no such option, but it also allows you to connect so.

The sample project: WindowsFormsApplication11.zip (1.1 МБ) (Updated)
CRC32: 3477FA15
MD5: 953D2F6CCD35929CA539750DC09E8485
SHA-1: A07123312DC6F070986C881714E1D5EE4BC2D502


Part 2
Also found out another problem with by Oracle (you can view the same example).
When regenerate Update DataBase From Model and set checkbox Recreate Database Tables previous Sequence not delete before adding new, and get error.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Thu 04 Jul 2013 10:55

We have sent you a modified sample project, which demonstrates the possible way to implement this scenario in your application.
Please check that the letter is not blocked by your mail filter.

As for the issue with "Update Database From Model" wizard with the selected "Recreate Database Tables" check box, we have reproduced it. We will investigate it and inform you about the results as soon as possible.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by AKRRKA » Thu 04 Jul 2013 15:30

Part 1
Thank you.
Yes, this is a solution, but very not beautiful.
It would be nice if you add a parameter to the connection string, and to switch the session did the component itself.
By the way UniConnection (from dotConnect Universal) the same problem.
Is not very convenient.

Part 2
Thank you.It is waiting.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Fri 05 Jul 2013 05:28

AKRRKA wrote:It would be nice if you add a parameter to the connection string, and to switch the session did the component itself.

We will consider the possibility to add this parameter to the connection string, but we can't tell any timeframe at the moment. We will inform you about the results as soon as any are available.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Thu 18 Jul 2013 12:02

The bug with the "Recreate Database Tables" option for tables which use sequences is fixed.
New build of LinqConnect 4.2.292 is available for download now!
It can be downloaded from http://www.devart.com/linqconnect/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=31&t=27551.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by AKRRKA » Tue 05 Nov 2013 09:01

And what parameter has been added to the connection string to support the connection to the other scheme.
Please give an example of the connection string.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Tue 05 Nov 2013 13:35

AKRRKA wrote:
It would be nice if you add a parameter to the connection string, and to switch the session did the component itself.
This feature has not been implemented yet and we can't tell any timeframe at the moment. We will inform you about the results as soon as any are available.

AKRRKA
Posts: 198
Joined: Thu 26 Jan 2012 15:07
Location: Russia
Contact:

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by AKRRKA » Thu 20 Mar 2014 06:34

Hello,

Any news?

Thanks.

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: LinqConnect Professional Version 4.2.272 (20-Jun-2013) - Oracle Connection

Post by MariiaI » Thu 20 Mar 2014 14:28

This feature is not currently in our plans for the next release. We will definitely notify you if it is implemented.

Post Reply