{"action":"created","issue":{"url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/220","labels_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/220/comments","events_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/220/events","html_url":"https://github.com/jonwagner/Insight.Database/issues/220","id":103924504,"number":220,"title":"How to receive the result of QuerySql in a view web page?","user":{"login":"cy598","id":6813580,"avatar_url":"https://avatars.githubusercontent.com/u/6813580?v=3","gravatar_id":"","url":"https://api.github.com/users/cy598","html_url":"https://github.com/cy598","followers_url":"https://api.github.com/users/cy598/followers","following_url":"https://api.github.com/users/cy598/following{/other_user}","gists_url":"https://api.github.com/users/cy598/gists{/gist_id}","starred_url":"https://api.github.com/users/cy598/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy598/subscriptions","organizations_url":"https://api.github.com/users/cy598/orgs","repos_url":"https://api.github.com/users/cy598/repos","events_url":"https://api.github.com/users/cy598/events{/privacy}","received_events_url":"https://api.github.com/users/cy598/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-30T13:47:16Z","updated_at":"2015-08-31T12:50:31Z","closed_at":"2015-08-31T12:50:31Z","body":"I do love this tool. And i do have written my first insightdb controller. It accessed my database favorably, the only question is how to receive the result of QuerySql in a view web page.\r\n\r\nI used the follow codes in my controller:\r\n\r\n<pre>var mydb = new MySqlConnectionStringBuilder(\"....connectionstring...\");\r\n// run a query right off the connection (this performs an auto-open/close)\r\nvar provinces = mydb.Connection().QuerySql(\"SELECT * From provinces\");\r\nreturn View(provinces.ToList());</pre>\r\n        \r\nAnd used the follow codes in my view (index.cshtml)\r\n\r\n<pre>@model IEnumerable<MySQL_MVC_Template1.Models.provinces>\r\n@{   WebGrid grid = new WebGrid(Model);}\r\n\\<h2\\>provinces List\\<h2\\>\r\n\\<div id=\"grid\"\\> \r\n  @grid.GetHtml()\r\n\\</div\\></pre>\r\n\r\nBut the system showed me : the import is “System.Collections.Generic.List\\`1[Insight.Database.FastExpando]”，but the dictionary needs “System.Collections.Generic.IEnumerable\\`1[MySQL_MVC_Template1.Models.yunclear_provinces]”。\r\n\r\nSo, how can i show the query result in the view? thank you."},"comment":{"url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/comments/136362384","html_url":"https://github.com/jonwagner/Insight.Database/issues/220#issuecomment-136362384","issue_url":"https://api.github.com/repos/jonwagner/Insight.Database/issues/220","id":136362384,"user":{"login":"jonwagner","id":1652596,"avatar_url":"https://avatars.githubusercontent.com/u/1652596?v=3","gravatar_id":"","url":"https://api.github.com/users/jonwagner","html_url":"https://github.com/jonwagner","followers_url":"https://api.github.com/users/jonwagner/followers","following_url":"https://api.github.com/users/jonwagner/following{/other_user}","gists_url":"https://api.github.com/users/jonwagner/gists{/gist_id}","starred_url":"https://api.github.com/users/jonwagner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonwagner/subscriptions","organizations_url":"https://api.github.com/users/jonwagner/orgs","repos_url":"https://api.github.com/users/jonwagner/repos","events_url":"https://api.github.com/users/jonwagner/events{/privacy}","received_events_url":"https://api.github.com/users/jonwagner/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T12:50:31Z","updated_at":"2015-08-31T12:50:31Z","body":"The wiki has some great examples. That's about all I can provide at this time."}}