Entity Framework: Access/ debug SQL - abp

I like to view my SQL queries generated by AdpDbContext in my logging infrastrucutre.
I come accross following article https://www.entityframeworktutorial.net/efcore/logging-in-entityframework-core.aspx but I am not sure how to integrate it with the existing abp infrastructure?
Can you please give me a hint how I can log the SQL queries to the existing Logging infrastructure?

When run a project HTTP Api on VS2019 you can get access to this information on output console log. All the information is shown on this feature. Check it out...

Related

How to Trigger POST method of URL from TSQL?

We are currently working with content database processes running over SQL Server 2008. To make a new feature for automation purposes we need to raise a POST method of an internal web application URL ( the app just get our code from team foundation and build projects on a remote server) from T-SQL code.
Is there any way to do that?
Any help will be really appreciated.
#jcolebrand: your approach to create a CLR stored procedure and make it available on the server to raise the POST method was the solution for my problem. Thanks.
Here is what I did:
Created the CLR stored procedure on VS over 3.5 net framework. To create this kind of projects go to Add New Project... > Other Project Types > Database and give a proper name.
Went to the database, set the database "Owner" property to "sa" user.
Set "TRUSTWORTHY" property to "ON" on the target database.
Deployed the CLR stored procedure with PERMISSION LEVEL : EXTERNAL
Hope this answer helps others too.
Don hesitate to contact me if you have questions.
Thanks all for responding!
I have to say that I agree with the others on this one... create a CLR procedure, .NET code, PowerShell or something else that can be called.
But if it has to come from T-SQL.
You could (shuddering).. do and XP_CMDSHELL and then call CURL to do the post.
A good example is located here.
And if you need to format the curl command there are great resources out on the web such as this one.
Good luck on this one but please note on the permissions and outright dangers of using of xp_cmdshell!!

.svc handler for IIS Server

While configuring the SQL Server 2012 Master Data Services, I am having following problem
The required .svc handler mappings are not installed in IIS.
What I want to do is that, I want to query my database using a URL so that I can retrieve data directly using the URL it self just like we can store the querystring parameters into SQL Server
How do I deal with it, I followed several documents but not any ideas.
To fix this issue, open a command prompt and go to the .NET directory
(for example %windir%\Microsoft.NET\Framework64\v4.0.30319).
Run the command: aspnet_regiis –i
For further details check:SVC Handler mapping error in MDS Configuration Manager
I've come across these types of errors a few times when installing MDS, the problem usually comes about because just having IIS installed is not enough, there are loads of other role services and features that you need to enable and install as well which the setup program doesn't tell you about.
Thankfully they are all documented here:
Web Application Requirements (Master Data Services)
And, if you've missed any, you can go back, install them and then re-launch the configuration tool to complete the setup without having to re-install MDS from scratch.

ELMAH MS SQL logs viewer

We are using Elmah with MS SQL Server to log exceptions. The problem is that I do not find easy way how to navigate exceptions logged in database. Is there any Elmah SQL Server logs viewer or I missing something?
ELMAH logs are designed to be viewed using the ELMAH handler aka elmah.axd (assuming you have it configured correctly).
You are supposed to go onto the site and go to the handler to see the errors.
For example:
http://example.com/elmah.axd
Have you added the httpHandler used to view exceptions to your web.config file? Have a look at the example web.config here: http://code.google.com/p/elmah/downloads/detail?name=ELMAH-1.2-sample-web.config
Whilst not specifically using MS-SQL as your question states and although it's a paid service, you could use Elmah.io - a cloud based log viewer with a ton of neat features. Plus there's a free 30 day trial for you to test it out.
You can install a nuget package, which takes care of the integration into your apps for you here.
(Disclaimer: I am in no way affiliated with elmah.io).

SQL Server Merge Replication error

I am getting a very strange error message at one of our client sites and I am having very little luck trying to figure out what is going on.
Hr=80040154 ERR:OpenDB failed getting
pub version 28627
That is the error message that is from the Merge Agent (IIS) logs. From what I can tell, it is a COM error not being able to load a specific COM object, but I don't know which one. From that, I think this client might not have something installed, but I don't know what that something.
Does any one have any thoughts about what might not be installed? Any other ideas on how to troubleshoot this?
Thanks.
This error could be related to permissions: Did you configure a snapshot share and give the IUSER_Machine name rights to Read and List Files and Folders?
You could restart the synchronization with verbose history logging as described here: How to enable replication agents for logging to output files in SQL Server.
Check these:
Ensure your subscription database is not timing out on auto-grow.
Make sure there is enough space to apply the snapshot on the subscriber
It turns out that there was a DLL that wasn't registered. It was sqloledb.dll (C:\Program Files\Common Files\System\Ole DB). I found this by using the ?diag on the merge agent.
http:////sqlcesa35.dll?diag
That page shows a nice summary of the versions of DLLs that it is using and such. When I did that at the client's site, it showed "unknown" for the version of that DLL. Running regsvr32 on the DLL allowed sqlcesa35.dll to see it and the diag page showed a version number.

jBASE 4.1 Database Noobster Questions

I am a software developer with devlopment experience in C#, C++ .Net alongwith SQL Server 2005/08, Oracle and mysql. But somehow i dont get jBASE to work at Windows XP SP3 machine.
My goal is setup user accounts, create database on a JBASE ainstallation, authenticate and backup/restore few table via a C++ program. And i dont need to do it with builtin backup/restore tools of jBASE.
I am able to install jBASe 4.1 aling with all its accessories on my WINXPSP3 machine. I was able to run the jSlimserver and TEMENOUS server along with licnesing server. I was able to add the license key as well. But after that what i was supposed to do? i have no idea about it.
The docs and online help doesnt answer a simple question of how to create a database! The google search results from the jbase site all go to the 404 Pages!
Can a jBASE expert guide to the following steps:
Create a jBASE database.
Create users
Authenticate via those users
Connect to database
Create tables and insert data.
Connect via a C++ or C# program to connect to jBASE DB and backup/restore tables.
I know that this is too much too ask but i dont get to get the JBASE system. I cant get it to work on my System somehow. Btw, jdc and jexloree doesnt seem to do anything. I have checked that enironmental variables for jBASE are setup correctly and i have verified them. There are no extra JRE or JDK installations on my system. Besides all that, only licensing client, slim server and temenous server seem to run and listen for connections and no other execuatable ever seems to work.
A simple tutorial to achieve the objective will be highly appreciated. Also if anyone can point out the mistake that i have done or anything i might need to check, then please do so. I will be highly encouraged and obliged.
Thanks
Steve
I hope this will help, if you have not already found a why to do this.
Setup jBase User and Database
Create a Security Group called
'Jbase' or what every you want to
call it
Add a User to this group. I would
recommend adding your administrator
user to it as well
Create a folder in you file system
to save the database information
into
Assign the 'Jbase' Security group to
the folder, and give it "Full"
read/write/execute access.
Creating the database:
Make sure the current users you
are logged on with is the 'Jbase'
security group.
go to the command prompt, and CD
to the folder you create to store
the database
run the jShell 'jsh' from that
location
use CREATE-FILE to create the
files/tables you want to store your
information in.
Inserting data:
There are several ways to enter data. You can use ED, your can your programming environment, or you can create a quick MultiValue/jBase compiled server script to ask for the data and write them to a file/table.

Resources