Posts

Showing posts from July, 2009

Coding Guidelines

We are lucky to have a client that is tech savvy. And most of the times our code is being reviewed by their tech architects.  Most of the times we get reviewed our code on a frequent time intervals. On one side it is good, on the other side it leaves our developers with some morel loss. Adding to the fuel, is me. I insist my developers to follow certain standards within their code. It is time to post the general points that I emphasize. 1)    Use long names for variables 2)    Initialize variables at the time of declaration 3)    Use .Equals instead of == 4)    Use territory operator ?: 5)    Use ?? when expecting the null reference 6)    Use .Length() comparison  to validate string with values 7)    Use StringBulder instead of strings concatenation 8)    Use StringBuilder replace instead of string (Ref : http://dotnetperls.com/replace-string-use) 9)    Use single line assignments for common values 10)    Avoid try catch as much possible 11)    Organize Usings and remove & sort th

Copy binary table data from diff servers

Today, before we start an internal demo of our project, we realized that, on a particular table there is no data in the QA server. We have every thing ready, but no the sample data. We just can’t create an insert script from the table and execute the script there, because, there is a column which is binary type. When we generate the script, the binary data type is not able to populate. Then we are struck with a big question of how to transfer the data between servers. Let me explain you much in detail about our infra structure. We have a dev DB server for our internal development hosted on 192.168.2.10 <<local ip address; for our convenience >> We have a test bed for our application and IIS installed on it, let’s say this is 192.168.3.10 , which is altogether a different network. And this IIS is connecting to a TestDB Server (let’s say it is hosted on 192.168.3.20 ), where we migrate our DB scripts to create the database / tables / stored procedure / user defined functio