This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@functions | |
{ | |
// for PetaPoco you must first create a class containing the fields you want | |
private class fileRecord | |
{ | |
public int FileId {get;set;} | |
public string FileName { get; set; } | |
public int Size { get; set; } | |
public int FolderId { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Configuration | |
@using System.Data | |
@using System.Data.SqlClient | |
@{ | |
var conString = ConfigurationManager.ConnectionStrings[Content.ConnectionName].ToString(); | |
var sqlCommand = "Select Top 10 * from Files Where PortalId = @PortalId"; | |
var adapter = new SqlDataAdapter(sqlCommand, conString); | |
adapter.SelectCommand.Parameters.Add("@PortalId", Dnn.Portal.PortalId); | |
var fileTable = new DataTable(); | |
adapter.Fill(fileTable); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Configuration | |
@using System.Data.SqlClient | |
@{ | |
var conString = ConfigurationManager.ConnectionStrings[Content.ConnectionName].ToString(); | |
var con = new SqlConnection(conString); | |
con.Open(); | |
var command = new SqlCommand("Select Top 10 * from Files Where PortalId = @PortalId", con); | |
command.Parameters.Add("@PortalId", Dnn.Portal.PortalId); | |
SqlDataReader myReader = command.ExecuteReader(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |