Wednesday, January 16, 2019

Add Visual Studio solution to Github through command line


Add Visual Studio solution to Github using command line

git init
git add .
git commit -m "Initial commit"

git config --global user.name "your_git_username"
git config --global user.email "your_git_email"

git remote add origin https://github.com/<yourusername>/yourrepositoryname.git

git push -u origin master


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?

Thursday, May 26, 2011

Database Table Size

If you want to know the size of your database table in bytes, use the below command. 

sp_spaceused <your_table_name>

Saturday, April 23, 2011

T-SQL for finding SQL Server Version

SELECT
    CAST(SERVERPROPERTY('ProductVersion') AS varchar(100)) + ' ' +
    CAST(SERVERPROPERTY('Edition') AS varchar(100)) + ' ' +
    CAST(SERVERPROPERTY('ProductLevel') AS varchar(100));

React.js multiselect dropdown using Material UI

React Multi-Select Country → State → City Dropdown (Service Based) React Material UI Multi-Select Dropdown (Count...