Monday, August 5, 2013

SQL Compact Godaddy

Scott Guthrie has explained in detail regarding SQL Compact CE 4.0 embedded database in his article.

Godaddy customer support idiots have mentioned, they don't support SQL Compact CE 4.0. Read their post

Below are the steps you need to follow while hosting SQL Compact CE 4.0 with Godaddy

1. You can have multiple ".sdf" files in your "App_Data" folder

2. You need give read / write access to the above folder (or wherever your .sdf files are located). Also make sure that, there is no read-only attribute checked on your .sdf files

3. Go to your "bin" folder of your application

4. The folder structure should be like below

bin\System.Data.SqlServerCe.dll

bin\amd64
bin\amd64\Sqlceca40.dll
bin\amd64\Sqlcecompact40.dll
bin\amd64\ Sqlceer40EN.dll
bin\amd64\Sqlceme40.dll
bin\amd64\Sqlceqp40.dll
bin\amd64\Sqlcese40.dll
bin\amd64\Microsoft.VC90.CRT
bin\amd64\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
bin\amd64\Microsoft.VC90.CRT\msvcr90.dll

bin\x86\Sqlceca40.dll
bin\x86\Sqlcecompact40.dll
bin\x86\Sqlceer40EN.dll
bin\x86\Sqlceme40.dll
bin\x86\Sqlceqp40.dll
bin\x86\Sqlcese40.dll
bin\x86\Microsoft.VC90.CRT
bin\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest
bin\x86\Microsoft.VC90.CRT\msvcr90.dll

Connecting to Database programmatically from C#

Connection string
<add name="compactCEdb1" connectionString="Data Source=|DataDirectory|\Database1.sdf" providerName="System.Data.SqlServerCe.4.0"/>

string conString = System.Configuration.ConfigurationManager.ConnectionStrings["compactCEdb1"].ConnectionString;
 string commandString = "Select empId from employee";
SqlCeConnection conn = new SqlCeConnection(conString);

            try
            {
                conn.Open();
                SqlCeCommand cmd = new SqlCeCommand(commandString, conn);
                string empId = cmd.ExecuteScalar().ToString();               
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
           
           




Tuesday, July 23, 2013

Wildcard subdomain - Hostgator

Hostgator does not support Wildcard subdomain on a shared windows hosting. 


Although you can create an A record with "*" and your IP Address, the page will be redirected back to plesk default page.





One of the link says that IIS doesn't support wildcard. This is not completely true.

So before buying a shared plan from Hostgator, please be aware of this. Otherwise you will end up spending money and your time with endless waiting for technical support and sometime they really suck.

Hostgator, why the hell you don't mention these kind of technical details on your website?

AZ-104

Microsoft Azure is huge and it has hundreds of services underneath its umbrella It's actually going to be quite difficult to comprehend ...