I want to rearrange serial no field after deleting an item from table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saifulhaque
    New Member
    • Aug 2010
    • 16

    I want to rearrange serial no field after deleting an item from table

    Hi dear

    I am working with small program. In my project I have Database field S_NO (serial no).I want to rearrange serial no field after deleting an item from that table like( 1,2,3... etc).How can it possible using C# code. Or by updating serial no field


    Expecting Help
    Last edited by Niheel; Aug 10 '10, 07:35 PM.
  • MrMancunian
    Recognized Expert Contributor
    • Jul 2008
    • 569

    #2
    Write an update query and execute it.

    Steven

    Comment

    • saifulhaque
      New Member
      • Aug 2010
      • 16

      #3
      Can you give an example for updating multiple number of Records ( field name - SL_NO) in single Button_Click Event using C#.

      Comment

      • MrMancunian
        Recognized Expert Contributor
        • Jul 2008
        • 569

        #4
        Have you already tried Google or MSDN?

        Steven

        Comment

        • saifulhaque
          New Member
          • Aug 2010
          • 16

          #5
          yes i have

          Comment

          • MrMancunian
            Recognized Expert Contributor
            • Jul 2008
            • 569

            #6
            Show us what you've already got, so we can see what's happening.

            Steven

            Comment

            • saifulhaque
              New Member
              • Aug 2010
              • 16

              #7
              When i am deleting a particular item using delete

              query,I want to rearrange serial no field

              of all items after deleting an item.How it possible

              using c# code

              Comment

              • MrMancunian
                Recognized Expert Contributor
                • Jul 2008
                • 569

                #8
                The question is clear, we're just not the forum that hands out code like that. We try to encourage you to find it out yourself. If there is a problem with your solution, we're happy to look into it, but if you don't bring any code, you're not getting any.

                Try reading the following two articles: How to Use a Database in Your Program Part I and How to Use a Database in Your Program Part II and come back if you have a specific question.

                Steven

                Comment

                • Frinavale
                  Recognized Expert Expert
                  • Oct 2006
                  • 9749

                  #9
                  What I don't get is why you want to rearrange your table?

                  Who cares how the data is stored...sort the contents being displayed to the user based on the column of your choice...

                  -Frinny

                  Comment

                  • saifulhaque
                    New Member
                    • Aug 2010
                    • 16

                    #10
                    I want move record back and forth by serial no.

                    Comment

                    • Frinavale
                      Recognized Expert Expert
                      • Oct 2006
                      • 9749

                      #11
                      Do you mean Sort?

                      Comment

                      • saifulhaque
                        New Member
                        • Aug 2010
                        • 16

                        #12
                        No, Not sorting ,I want to display Serial no of 1st record in a textbox , and using back and forth button i want to move record to last and first.I want to rearrange serial no of records when deleting an item.

                        Comment

                        • Frinavale
                          Recognized Expert Expert
                          • Oct 2006
                          • 9749

                          #13
                          I understand now :)Is this an ASP.NET application or a desktop application?

                          Comment

                          • saifulhaque
                            New Member
                            • Aug 2010
                            • 16

                            #14
                            ASP.NET application

                            Comment

                            Working...