Skip to main content

Posts

Showing posts with the label language-sql

Fixing Wordpress Database Collation for Foreign Fonts

I wanted to write Japanese in one of my wordpress blogs. The issue was that the encoding was in latin1. Here are the steps I used below. Keep in mind that this is a potentially dangerous modification where you could easily lose your data. Be careful and if you try this, you do it at your own risk! Make a complete backup of your site by whatever methods you normally use. Also make a backup of your wordpress site’s database. Login into CPanel and select phpMyAdmin. Click the SQL tab around the top of the page on the right panel. This is where you can execute SQL code. ALTER DATABASE dbname DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; (where dbname is the name of your database) That line fixes the existing database by changing the default encoding. In my case I had a latin1 variant. That step above is to avoid completely dropping and re-creating the database. Login into CPanel again and download a copy of the database using the backup wizard. This consists of a tar.gz (zip...

DLL Files And .NET ClickOnce Deployment

I want to deploy one of my .NET apps as a ClickOnce application. The issue is that I am connecting to Oracle (see previous posts here and here ). Connecting to Oracle requires at least, 4 DLL files that generally have to be in the same directory as the EXE file. The issue is that when the program is published, the DLLs are not referenced in any way, so the program won’t work. Then I read about adding the files to the project, so that ClickOnce and the Publish processor will figure out that the DLLs are required and add them to the manifest. Here is the process in Visual Studio 2005: Put the 4 DLL files in their own directory in your solution directory (for ease of use mostly). Add all four files to your project by going to “Project->Add Existing Item…” Click on each DLL file in the solution explorer and then change their property: “Copy To Output Directory” to “Copy Always”. That’s it! Now when I publish or even run the application I don’t have to worry about if the DLL files...

C# .NET Programming Tip: Oracle Connection Revised

Take not that Microsoft will discontinue support for System.Data.OracleClient in .NET 4.0. This method should still work, but it will be depreciated… Now that I have had more time to work with Oracle, I found a better way to connect then described in my previous post . With this new method you can connect to multiple instances in one program by getting rid of that tnsnames file. *Remember that a project reference to System.Data.OracleClient must be added: OracleConnection dbConnection; string connectionString = "Server=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = *******)(PORT = 1521))(CONNECT_DATA = (SID = *****)));Persist Security Info=true;User Id=*****;Password=*****;"; dbConnection = new OracleConnection(connectionString); It’s really that simple. The key here is that the connection string must use the “Server” attribute instead of the “Data Source” one. I ran upon that while looking at the specification on Microsoft’s MSDN documentation site. It’s basically a t...

C# .NET Programming Tip: Connecting to an Oracle Database

Take not that Microsoft will discontinue support for System.Data.OracleClient in .NET 4.0. This method should still work, but it will be depreciated… Please view this post for a better way to connect to Oracle. Ugh, I spent a good 6 hours figuring out how to do this! Hopefully this post can save someone some time. Connecting to an Oracle database requires driver files from Oracle. This is true no matter what you use in Visual Studio, it true for System.Data.ODBC or whatever else. This little factoid took me a while to figure out, as I didn’t want to believe that I had to install a 200mb piece of software from Oracle just to connect to one of their databases. Well thankfully I didn’t have to install their standard client. They offer an “instant client” that is quite a bit smaller. They even offer a lite version of the instant client, which is the one I decided to use. The bad thing about it is even that is around 20mb in size. You can download it here: http://www.oracle.com/tec...

Drupal: CMS Migration To A Server

I’ve been modifying Drupal (drupal.org) for a neighborhood organization website. It took a little research as, like most similar open-source projects, the documentation leaves something to be desired. I now have the site to a point where I want to put it up on the Internet. I have some hosting, so I got the domain… and bam, it’s on the web right? Well no. I feel it is necessary to make a general process overview as it took a good deal of research and tweaking to get it working: -I have “reseller hosting.” That means I can host multiple domains with the space/bandwidth that comes with the yearly fee. I bought the neighborhood domain, added a special hosting plan (defines storage, bandwidth, and other properties), and tried configuring the dns information -Seeing as I have not done too much with the whole domainname-dns-nameserver-whatever configuration process I had some trouble figuring it out. What I ended up doing was having my domain name registrar create 2 name servers from ...

Finally got moving on something...

From the previous posts it’s easy to notice that I’ve been searching for an efficient way to code large web projects. While I am still open to frameworks and such, I had something happen that kind of “brought me back to my roots.” I have the job of making a website for a not-for-profit organization in my area. I decided that they should have something easy to update, so that means a data driven site with a back-end. I don’t want to use premade systems because they have too many things I don’t want included. I therefore decided to go with what I’ve worked with in the past which is straight PHP. More specifically PHP5+ and the SQLite database engine. PHP5 perfects a good deal of useful features over the older versions such as the class/object model. It also adds support built-in for the file based SQLite engine. For what I am creating, SQLite takes out a lot of the unnecessary complexity of using MySQL. I’ve got the database and gene...