How can I get log4net AdoNetAppender to insert NULL instead of "(null)" into my table? - log4net

Is there a way to get log4net to insert NULL into a database table using the AdoNetAppender and ODBC? One similar question suggested using a CASE clause in the insert command, but I can't do that because I have to use ODBC, which doesn't support named parameters. I am using ODBC because my application has to work with various types of databases, mainly SQL Server and PostgreSQL.

Related

Using Spotfire functions when connecting to a Database connection

I'm connecting my Spotfire to Postgres database. After connecting to the db some of the functions are not available in Spotfire. I want to know if there is a way I can be connected to the database and still use all the Spotfire functionalities. I have huge amount of data and I need to store it in a database as using Excel is not a viable solution. I understand when I connect to a database I can only use limited functions supported by the database. I wanted to know there is a way around this situation.
If there is a workaround like similar to qvd's in qlik or if I can store data in another dxp file and use that to import data.
I think you kept your data external, and that's why you can't use some Spotfire functionalities.
To have your data embedded, just select this option when you add a datatable. In the load method, select "import data" instead of "keep data external".
If you have too much data in your database, consider using the "load on demand" functionality to only get the data you want.
It is not because of external data, I spoke to Spotfire support they don't support this, if I'm connecting to a database, I'll only be able to use limited functions. I found an alternative solution though using information links.

Nhibernate for interops based database access

We have Oracle 11 as database for our third party server application. The interactions for db is only allowed through the interops DLLs provided by vendor. No direct access to database is allowed. We need to connect to the database using those DLLs for creating or deleting objects inside the database. I am wondering if I can use Nhibernate by writing some wrappers about those DLLs. No SQL queries are also allowed. Can this be done?
Who is vendor? Not Oracle I guess, but your "third party" providing the "application server" software.
In such case this looks like they want to forbid direct SQL access to their application DB. So there is no point trying to use an ORM such as NHibernate, it would be from their point of view almost like directly querying the DB.
Your "best" option is to ask them if they can provide their own NHibernate database driver, but their answer will very probably be "No".

Query Couchbase Views from Excel using Simba ODBC Driver

I am trying to query Couchbase data from Microsoft Office Excel using Simba ODBC Driver.
Querying Table using below statement works:
However, when I tried to query views it doesn't work, kept saying "Cannot create table ..."
Here's one of the many statements I tried to query above View
SELECT *
FROM Couchbase.default.`travel-sample`.`_design/dev_test` .`test_view` `travel-sample`
Is my syntax wrong? Or is it not possible at all?
For the benefits of other readers: this question was answered in the comments to this blog post. Querying views is currently not supported by the driver because N1QL doesn't have access to map-reduce views.

Attempting to make an existing SQL Server database compatible with the Windows Azure platform using SSDT

I'm attempting to make my existing SQL Server 2008 database compatible with the Windows Azure platform by using SSDT, however I am getting a whole bunch of errors when I build the project due to TVFs and views looking for an external database that sits in the same instance in SSMS.
I've added the database that its looking for into Azure, which wasn't a problem.
I've found that if I load the offending piece of code I can add the Azure server address to the FROM statement which resolves the error (shown below), however I have a huge number that rely on the external db and hoped there may be a quicker way?
FROM [myAzureserver.database.windows.net.ExternalDBName.dbo.TableName] as ALIAS
I understand that this issue would not exist if I merged the databases, however this isn't possible at present.
Thanks a lot for your help.
Why are you trying to make your local SQL Server Azure compliant? Are you planning to move it at some point in the cloud? If so, you won't be able to use linked servers. Your FROM clause will work as long as the database remains on an on-premise SQL Server instance.
Assuming that's what you want to do, you are asking if there is quicker way to change your references to point to the cloud database, right? I am not sure if this will work for you but I had a similar issue on another project and ended up using synonyms. Check our synonyms here: http://msdn.microsoft.com/en-us/library/ms177544.aspx. Although you can't create a synonym for a server, you can create synonyms for tables/views/procs.
Again, this may not work for you, but let's try this...
Assuming you have your primary database called DB1, the secondary database called DB2, and the cloud database of DB2 called AzureDB2, you could create synonyms in DB2 to point to the cloud database without changing any SQL statement from DB1.
So assume you have this statement today in DB1:
SELECT * FROM DB2.MyTable
You could create a synonym in DB2 called MyTable:
CREATE SYNONYM MyTable FOR [myAzureserver.database.windows.net.ExternalDBName.dbo.TableName]
DB2 becomes a bridge basically. You don't need to change any statement in DB1; just create synonyms in DB2 that point to the cloud database.
Hopefully this works for you. :)

SubSonic-based app that connects to multiple databases

I currently developed an app that connects to SQL Server 2005 database, so my DAL objects where generated using information from that DB.
It will also be possible to connect to an Oracle and MySQL db, all with the same table structures (aside from the normal differences in fields, such as varbinary(max) in SQL Server and BLOB in Oracle, and so on). For this purpose, I already defined multiple connection strings and multiple SubSonic providers for the different DB's the app will run on.
My question is, if I generated my objects using a SQL Server database, should the generated objects work transparently with the other DB's or do I need to generate a different DAL for each database engine I use? Should I be aware of any possible bugs I may encounter while performing these operations?
Thanks in advance for any advice on this issue.
I'm using SubSonic 2.2 by the way....
From what I've been able to test so far, I can't see an easy way to achieve what I'm trying to do.
The ideal situation for me would have been to generate SubSonic objects using SQL Server for example, and just be able to switch dynamically to MySQL by just creating at runtime the correct Provider for it along with its connection string. I got to a point where my app would correctly connect from SQL Server to a MySQL DB, but there's a point where the app fails since SubSonic internally generates queries of the form
SELECT * FROM dbo.MyTable
which MySQL doesn't support obviously. I also noticed queries that enclosed table names with brackets ([]), so it seems that there are a number of factors that would limit the use of one Provider along multiple DB engines.
I guess my only other option is to sort it out with multiple generated providers, although I must admit it does not make me comfortable knowing that I'll have N copies of basically the same classes along my project.
I would really love to hear from anyone else if they've had similar experiences. I'll be sure to post my results once I get everything sorted out and working for my project.
Has any of this changed in 3.0? This would definitely be a worthy reason for me to upgrade if life is any easier on this matter...

Resources