public IHttpActionResult Get()
return Json(new { res = ex.Message });
public IHttpActionResult text()
{
try
{
SqlConnection sqlConnection =
new SqlConnection(
"Data Source=(local);Initial Catalog=filemaneger;Persist Security Info=True;User ID=sa;Password=123456");
sqlConnection.Open();
string sql = "select fileid,filename,filetype,CreateDate,path from fileall where 1=1 ";
DataSet dataSet = new DataSet();
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sql, sqlConnection);
sqlDataAdapter.Fill(dataSet);
List<table> lt = DataSetToList<table>(dataSet, 0);
var total = lt.Count;
var rows = lt.Skip(0).Take(10).ToList();
return Json(new { total = total, rows = rows }, GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings);
}
catch (Exception ex)
{
return Ok(ex.Message);
}
}