This is a migrated thread and some comments may be shown as answers.

How to use Profiler with LocalDB?

4 Answers 92 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Keith
Top achievements
Rank 1
Keith asked on 27 Jun 2012, 05:12 AM
I haven't been able to connect the Profiler (V 2012.2.607.1) to connect to LocalDB.

I've tried as Server:

(LocalDB)\V11.0
but I get an invalide URI error

localhost
gives no error but doesn't connect

I'm pretty sure I've followed all the steps, including the startup code, the backend configuration, and the reference.

How do I do this?

BTW, here's my connection string:

<add name="ConStrApptHero" connectionString="data source=(LocalDB)\V11.0;initial catalog=MyDB;integrated security=True" providerName="System.Data.SqlClient" />

4 Answers, 1 is accepted

Sort by
0
Keith
Top achievements
Rank 1
answered on 28 Jun 2012, 11:06 PM
Can I get an answer to this?

Does Profiler work with LocalDB?

If so, how can I figure out what I'm doing wrong?
0
Accepted
Alexander
Telerik team
answered on 29 Jun 2012, 12:09 PM
Hi Keith,

Sorry for the delayed reply, we are quite busy with the preparation of the new service pack.
The OpenAccess profiler is used absolutely the same way with LocalDB as with any other backend:
- Enable logging data in the rlinq file, as described here. You could try a higher log level like Verbose or All in order to get more messages.
- Start the profiler service at the beginning of the application execution.
- Connect the profiler using localhost as server name (if the application is running on your local machine), the port specified in the StartProfilerService method call and the connection string name used in the application.

Please note that if the application has not been started yet, the profiler will not be able to connect and will display errors. However, it will continue trying to connect and if you start the application later, you should be able to see the log data.
If the application is running and an OpenAccessContext instance is already created (a connection to the database has been established), you should even be able to see the connection string in the combobox of the Profiler's Open Connection dialog.
Hope that helps.

Greetings,
Alexander
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
0
Keith
Top achievements
Rank 1
answered on 29 Jun 2012, 04:18 PM
Thank you for your reply.

Turns out it was my own stupidity.

I had added this

Telerik.OpenAccess.ServiceHost.ServiceHostManager.StartProfilerService(15555)

to my main form, but for troubleshooting, I created a test startup form and failed to put that code in it's Load.

So, everything I was testing with profiler failed because my test form didn't have that code.

Sorry to have wasted your time.

But, you answer did help me by confirming that localhost is the correct server for LocalDB.
0
Alexander
Telerik team
answered on 29 Jun 2012, 04:26 PM
Hi Keith,

I am happy to see that you have found the problem. Please note that the server address is not the address of the database server, but the address of the machine where the OpenAccess profiler service is running. So if your application is running locally, the server will always be localhost, for any backend. If you are profiling an application running on a remote machine, you should use the IP of that machine instead.

Kind regards,
Alexander
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
General Discussions
Asked by
Keith
Top achievements
Rank 1
Answers by
Keith
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or