home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
How To Do Native SQL Queries in TVE35 plugins
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="huha" data-source="post: 1030111" data-attributes="member: 63847"><p>I do ask for help on how to do native sql queries from a TVE35 plugin.</p><p></p><p>With the old TV server in MP1 I could do a native SQL query like</p><p></p><p>StringBuilder SqlSelectCommand = new StringBuilder();</p><p> SqlSelectCommand.Append("select * from Recording ");</p><p> SqlSelectCommand.AppendFormat(string.Format("where {0}", Expression)); </p><p> SqlStatement stmt = new SqlBuilder(StatementType.Select, typeof(Recording)).GetStatement(true);</p><p> SqlStatement ManualJoinSQL = new SqlStatement(StatementType.Select, stmt.Command, SqlSelectCommand.ToString(), typeof(Recording));</p><p> myRecordingList = ObjectFactory.GetCollection<Recording>(ManualJoinSQL.Execute());</p><p> Log.Debug("SQL Result:myRecordingList.Count" + myRecordingList.Count.ToString());</p><p></p><p>For the old server there was a definition of SqlStatement, Objectfactory and SqlBuilder in Gentle.Framework, which i could not find for the new TvE35. </p><p></p><p>As this is my biggest roadblock on the path to write my first plugin for TVE35 I would appreciate any help here.</p><p></p><p>Another issue is the deletion of a setting, but I guess if I could do a general SQL query i could do the deletion from there.</p></blockquote><p></p>
[QUOTE="huha, post: 1030111, member: 63847"] I do ask for help on how to do native sql queries from a TVE35 plugin. With the old TV server in MP1 I could do a native SQL query like StringBuilder SqlSelectCommand = new StringBuilder(); SqlSelectCommand.Append("select * from Recording "); SqlSelectCommand.AppendFormat(string.Format("where {0}", Expression)); SqlStatement stmt = new SqlBuilder(StatementType.Select, typeof(Recording)).GetStatement(true); SqlStatement ManualJoinSQL = new SqlStatement(StatementType.Select, stmt.Command, SqlSelectCommand.ToString(), typeof(Recording)); myRecordingList = ObjectFactory.GetCollection<Recording>(ManualJoinSQL.Execute()); Log.Debug("SQL Result:myRecordingList.Count" + myRecordingList.Count.ToString()); For the old server there was a definition of SqlStatement, Objectfactory and SqlBuilder in Gentle.Framework, which i could not find for the new TvE35. As this is my biggest roadblock on the path to write my first plugin for TVE35 I would appreciate any help here. Another issue is the deletion of a setting, but I guess if I could do a general SQL query i could do the deletion from there. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
How To Do Native SQL Queries in TVE35 plugins
Contact us
RSS
Top
Bottom