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

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -