Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. row and column access in database

row and column access in database

Scheduled Pinned Locked Moved ASP.NET
database
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    comp_j
    wrote on last edited by
    #1

    I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.

    A B B A 4 Replies Last reply
    0
    • C comp_j

      I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      I cant find any meaning.. you can loop through the DataTable fetched from the database.. or you can loop using DataReader.. What else do you need.? ? :confused::confused:

      Abhishek Sur My Latest Articles Working with Excel using MDAC
      Basics on LINQ and Lambda Expressions
      Create .NET Templates

      1 Reply Last reply
      0
      • C comp_j

        I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.

        B Offline
        B Offline
        Blue_Boy
        wrote on last edited by
        #3

        You want searching data on DB by TSQL?


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

        1 Reply Last reply
        0
        • C comp_j

          I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.

          B Offline
          B Offline
          Baran M
          wrote on last edited by
          #4

          Do you like to compare Your Column of values with the database's column of values ?

          Education is not a way to escape poverty — it is a way of fighting it.

          C 1 Reply Last reply
          0
          • C comp_j

            I'm trying to do a search on a field of a database.What I need is the method for directly accessing to a specific row and column (Without using Gridview)for comparing my data and database's datas.

            A Offline
            A Offline
            ais07
            wrote on last edited by
            #5

            What you want explain in brief.

            Life Is Beautiful

            1 Reply Last reply
            0
            • B Baran M

              Do you like to compare Your Column of values with the database's column of values ?

              Education is not a way to escape poverty — it is a way of fighting it.

              C Offline
              C Offline
              comp_j
              wrote on last edited by
              #6

              Let my explain what I want with an example: I want copmare TextBox's value with column ID in Database then if they were equal, modify Qyt column. int intPosition_ID; objDataView.Sort = "ID"; intPosition_ID = objDataView.Find(TextBox.Text); if (intPosition_ID != -1 ) { // modify Qyt column that is ID=TextBox. }

              B 1 Reply Last reply
              0
              • C comp_j

                Let my explain what I want with an example: I want copmare TextBox's value with column ID in Database then if they were equal, modify Qyt column. int intPosition_ID; objDataView.Sort = "ID"; intPosition_ID = objDataView.Find(TextBox.Text); if (intPosition_ID != -1 ) { // modify Qyt column that is ID=TextBox. }

                B Offline
                B Offline
                Baran M
                wrote on last edited by
                #7

                You can try this, if you use SQL server 2005 select name from sys.columns where object_id = (select object_id from sys.tables where name = 'tablename')

                Education is not a way to escape poverty — it is a way of fighting it.

                C 1 Reply Last reply
                0
                • B Baran M

                  You can try this, if you use SQL server 2005 select name from sys.columns where object_id = (select object_id from sys.tables where name = 'tablename')

                  Education is not a way to escape poverty — it is a way of fighting it.

                  C Offline
                  C Offline
                  comp_j
                  wrote on last edited by
                  #8

                  Yeah, Im using SQL server 2005. Im beginner in ASP.NET and plz explain it more clearly. I didnt understand your code and I dont know what am I suppose to do ! :confused:

                  B 1 Reply Last reply
                  0
                  • C comp_j

                    Yeah, Im using SQL server 2005. Im beginner in ASP.NET and plz explain it more clearly. I didnt understand your code and I dont know what am I suppose to do ! :confused:

                    B Offline
                    B Offline
                    Baran M
                    wrote on last edited by
                    #9

                    if I understood your requirement correctly, you want to compare the textbox value with a table's all columns. For that you can use that query. Sys.Columns is system table which contains all the table's columns. By referring the object_id you can fetch the required column. select name from sys.columns where object_id = (select object_id from sys.tables where name = 'customer') and name = 'LastName' If you have AdventureWorksLT database you can try this. Let us know whether it solves your problem.

                    Education is not a way to escape poverty — it is a way of fighting it.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups