ICursor
-
-
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.
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 aSqlConnection
(you use this to Open the connection to the database) and then useExecuteReader
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 -
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 aSqlConnection
(you use this to Open the connection to the database) and then useExecuteReader
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 -
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 ?
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 -
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 -
what about DataTable Or .... ? ( give me advice ) can get ICursor from that? I should some how get ICursor any way ? thanks in advanced!
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 -
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 -
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.
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