How to store Abbreviation name in database sql server Through c# programming -


I have a web form, in this web form I have a text box and a button if I click on a data in the text box Add as "Andhra Pradesh" , then when I click on the button, it stores "AP" in the database

Any one can help me write in C # so it's like to have code.

  • If I enter Andhra Pradesh then store it in the database AP
  • If I enter Madhya Pradesh, then store MP in this database.
  • If I enter West Bengal then this database is stored in West Bengal.

    If statename = "Andhra Pradesh" then statename = "AP" and if

    It will come back only to the first 2 characters in the uppercase.

      string test = "Andrpra dais"; String abbreviated = new string (test.Where (t = & gt; char.IsUpper (t)). Take (2) .ToArray ()); Console.WriteLine (abridged);   

    Though I'm thinking that your rules should consider the possibility of two or more results with the same short wire

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -