.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Hard Coding Removal

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :Sql Server


I have this following where clause in a query that is being frequently used


from  Table_A

where COLUMN_A = 'ABC' and COLUMN_B IN ('d','e','f')

and COLUMN_C <> 'XYZ' and COLUMN_D NOT IN ('p','q')

and COLUMN_E LIKE 'hij%' and COLUMN_F NOT LIKE 'lmn%'

now wht i would like to do is remove hardcoding from this query. I was thinking about having a central repository like a MetaData table which will store all the values. But then how would i join this metadata table for  LIKE and NOT LIKE cases.


View Complete Post

More Related Resource Links

User messages without hard coding


Hi All,


How to manage user messages to avoid hardcoding messages accross the web application.





Coding / Programming Tips for C#

Using proper guidelines and a template-framed style of coding will really helps developer to enjoy the coding with more understandable, reliable code and application development.

The void is invariant

while back I described a kind of variance that we've supported since C# 2.0. When assigning a method group to a delegate type, such that both the selected method and the delegate target agree that their return type is a reference type, then the conversion is allowed to be covariant. That is, you can say:

Best Coding Techniques To Improve Performance for SharePoint Applications

As more developers write custom code by using the SharePoint Object Model, they encounter common issues that can affect application performance.

The following areas reflect the main issues encountered by developers as they write custom code by using the SharePoint object model:

§ Disposing of SharePoint objects

§ Caching data and objects

§ Writing code that is scalable

WebMatrix shorthand coding?


Will there be support for shorthand statements?


@if(1==1) @: works
@else @: doesn't work

as apposed to;

    <text>doesn't work</text>

Or perhaps ternary opperators? PHP like stuff ...

Hard Code Roles on the Pages


If i hard coded role=Manager on the specific SiteMap/Folder/Page/etc. I will have problem when the manager need to remove from access a specific page. I need to change the code ont eh page/SiteMap/Folder more move the file into another folder.

What i have in mind is to change the role to taks oriented. such as role=AddStock, Edit Stock, Delete Stock, Print DO, Add Sales, Edit Sales, Deleted Sales..... (but it will be many role for 1 user compare to just 1 as Manager)

Will this cause performance issues later when each user have 60 roles and if i have 20,000 user will it affect the application performance?

Otherwise any other option? to make it flexible.

Invalid length for a Base-64 char array for my coding in ASP.net C#. How to solve it ?


Hi Friends ,

I have done encrypted password and decode but i got error  like  this  " Invalid length for a Base-64 char array" .

Pls help . Thanks


psswd = txtPassword.Text;

pwed = base64Decode(psswd);

public string base64Decode(string sData)
            System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
            System.Text.Decoder utf8Decode = encoder.GetDecoder();
            byte[] todecode_byte = Convert.FromBase64String(sData);
            int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
            char[] decoded_char = new char[charCount];
            utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
            string result = new String(decoded_char); return result;

Better Coding: Better Coding with Visual Studio 2010


From functional IDE improvements to better support for parallel programming, Visual Studio 2010 comes with a host of new features to help meet the needs of today's demanding, ever-changing development environment. Doug Turnure provides an overview of the more important ones and practical advice on how to use them.

Doug Turnure

MSDN Magazine April 2010

Coding Tools: Improved Support For Parallelism In The Next Version Of Visual Studio


We take a look at planned support for parallel programming for both managed and native code in the next version of Visual Studio.

Stephen Toub and Hazim Shafi

MSDN Magazine October 2008

Toolbox: Realistic Test Data, Dare Obasanjo's Blog, Color-Coding Tools, and More


This month Scott shows how to generate realistic test data, visits Dare Obasanjo's blog, and demonstrates color coding code for better readability.

Scott Mitchell

MSDN Magazine October 2008

Toolbox: Save Coding Time, Manage Compressed Files, and More


Save Coding Time, Manage Compressed Files, and More

Scott Mitchell

MSDN Magazine January 2007

Data Points: Efficient Coding With Strongly Typed DataSets


Someone once said to me that the hallmark of a good developer is the desire to spend time efficiently. Developers are continually pursuing ways to make coding easier and faster, and to reduce the number of errors.

John Papa

MSDN Magazine December 2004

App Lockdown: Defend Your Apps and Critical User Info with Defensive Coding Techniques


Whether you're storing database connection strings, user credentials, or logon info, you'll need to practice good defensive programming techniques to avoid those surprise situations in which your data is exposed. In this article, author Kenny Kerry shows you how.

Kenny Kerr

MSDN Magazine November 2004

Manually coding controls such as gridview, listview, repeater, etc.


using vs2010 and .net 4

In my project I have a separate DAL built from class files that I'd like to use to store my code for CRUD operations against my database.

I'm having a hard time finding examples of how to code server controls like the gridview, listview, repeater etc., for CRUD operations manually, i.e., without a datasource control of some flavor.

I don't have any problem manually coding the referenced controls to get my data, but I do have problems when it comes to coding them to perform CRUD operations unless I use a datasource control. When I use the datasource controls CRUD operations seem to automagically appear out of nowhere after they're configured.

Can someone point me to some samples somewhere? Have I missed a section at MSDN?


Video: Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services

Watch this visual how-to video as you learn to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0. (Length: 7:56)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend