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. General Programming
  3. C#
  4. ICursor

ICursor

Scheduled Pinned Locked Moved C#
databasecsharpsql-serversqlitesysadmin
8 Posts 3 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.
  • J Offline
    J Offline
    jojoba20
    wrote on last edited by
    #1

    hi , How to use this for sql server 2008

    SQLiteDatabase db = this.getReadableDatabase();
    ICursor mcursor = db.rawQuery(selectQuery, null);

    i wanna get ICursor from Sql Server 2008 in C# (somthing like Sqlite) cause i wanna use that in monodroid.

    P M 2 Replies Last reply
    0
    • J jojoba20

      hi , How to use this for sql server 2008

      SQLiteDatabase db = this.getReadableDatabase();
      ICursor mcursor = db.rawQuery(selectQuery, null);

      i wanna get ICursor from Sql Server 2008 in C# (somthing like Sqlite) cause i wanna use that in monodroid.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      ICursor isn't an interface that's supported in SQL Server. What you have here is SqlLite specific code. In order to do something similar with SQL Server, you would want to create a SqlCommand object, associate it with a SqlConnection (you use this to Open the connection to the database) and then use ExecuteReader to get the equivalent behaviour. However, I doubt that you will be able to do this for MonoDroid as you would be required to install SQL Server drivers on the Droid device. Sorry.

      I was brought up to respect my elders. I don't respect many people nowadays.
      CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

      J 1 Reply Last reply
      0
      • P Pete OHanlon

        ICursor isn't an interface that's supported in SQL Server. What you have here is SqlLite specific code. In order to do something similar with SQL Server, you would want to create a SqlCommand object, associate it with a SqlConnection (you use this to Open the connection to the database) and then use ExecuteReader to get the equivalent behaviour. However, I doubt that you will be able to do this for MonoDroid as you would be required to install SQL Server drivers on the Droid device. Sorry.

        I was brought up to respect my elders. I don't respect many people nowadays.
        CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

        J Offline
        J Offline
        jojoba20
        wrote on last edited by
        #3

        thanks for reply. I can use sql code without any problem. just i wanna get ICursor. is it possible to get ICursor even with Linq ?

        P 1 Reply Last reply
        0
        • J jojoba20

          thanks for reply. I can use sql code without any problem. just i wanna get ICursor. is it possible to get ICursor even with Linq ?

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          As my reply indicated - ICursor is for SqlLite. It isn't for SQL Server. If you want to use the SQL Server functionality, you have to use the types that are supported.

          I was brought up to respect my elders. I don't respect many people nowadays.
          CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

          J 1 Reply Last reply
          0
          • P Pete OHanlon

            As my reply indicated - ICursor is for SqlLite. It isn't for SQL Server. If you want to use the SQL Server functionality, you have to use the types that are supported.

            I was brought up to respect my elders. I don't respect many people nowadays.
            CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

            J Offline
            J Offline
            jojoba20
            wrote on last edited by
            #5

            what about DataTable Or .... ? ( give me advice ) can get ICursor from that? I should some how get ICursor any way ? thanks in advanced!

            P 1 Reply Last reply
            0
            • J jojoba20

              what about DataTable Or .... ? ( give me advice ) can get ICursor from that? I should some how get ICursor any way ? thanks in advanced!

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              Which bit of you can't do you not understand? Do you really not get that this is a SQLLite object?

              I was brought up to respect my elders. I don't respect many people nowadays.
              CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

              J 1 Reply Last reply
              0
              • P Pete OHanlon

                Which bit of you can't do you not understand? Do you really not get that this is a SQLLite object?

                I was brought up to respect my elders. I don't respect many people nowadays.
                CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

                J Offline
                J Offline
                jojoba20
                wrote on last edited by
                #7

                thanks !

                1 Reply Last reply
                0
                • J jojoba20

                  hi , How to use this for sql server 2008

                  SQLiteDatabase db = this.getReadableDatabase();
                  ICursor mcursor = db.rawQuery(selectQuery, null);

                  i wanna get ICursor from Sql Server 2008 in C# (somthing like Sqlite) cause i wanna use that in monodroid.

                  M Offline
                  M Offline
                  Mycroft Holmes
                  wrote on last edited by
                  #8

                  What is your fixation with ICursor, what are you actually trying to do. I can't help thinking you are asking the wrong question, what do you want to use ICursor for?

                  Never underestimate the power of human stupidity RAH

                  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