I have a SharpScript .ss script file with some small code that polls a database and formats things to display. The output is getting too unruly for command line output so I wanted to generate html and view things like that. Generating the html works fine with htmlDump in the .ss file, but when I create a small web project from one of their templates, the database connection stops working?
Is there any difference in how to specify the connection string for a website vs. a .ss script file?
I just have the regular args specification at the beginning of the file
<!--
db mssql
db.connection Server=ble\bla;Database=blu;user id=blo;password=#blingblong#
-->
This works fine in .ss script file, I can then do something like
```code
{{
"select * from View drv
join [Project] p on drv.ProjectId = p.ProjectId
where DocumentId = 'GUID' "
| dbSelect
| map => {it.RecordId, it.Text, it.Name}
| to => sqlMap
}}
sqlMap | count
sqlMap | textDump
```
and get output like the count (21) and a table from the textDump.
I then created a "bare-webapp" from a template with web new bare-webapp Name
and added a new html file with the same content, but that doesn't work? If I do
{{dbTableNames | count }}
{{db}}
I can see that the db argument is rendered in the browser as "mssql" like in the argument input, but the table names are not listed, and no sql queries work. I don't see any error messages or anything, so I have no idea what is going on? I thought SharpScript would be able to render the html page similarly to how .ss script files can access the database?