虽然听起来很简单,但我没有找到任何关于此的文档,也许我写错了所以如果是这样的话,一些关于此的好文档将不胜感激.我只想返回一个字符串或类型字符串的模型.
return "string here";
Run Code Online (Sandbox Code Playgroud)
我每次都会收到此错误:
Severity Code Description Project File Line
Error CS0029 Cannot implicitly convert type 'string' to 'System.Web.Http.IHttpActionResult' TaskManagement C:\dev\TaskManagement\TaskManagement\Controllers\JobsController.cs 157
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用CAST - 同样的错误.
return (IHttpActionResult)"string"
Run Code Online (Sandbox Code Playgroud) 我在表单上获取用户输入并将其绑定到一个参数,然后该参数将绑定到我的报表.我可以使用单个集合来保存所有参数吗?为我想要传递给报告的每个项目创建一个集合和一个参数似乎是多余的.
为了按照我的要求进行这项工作,我必须为我的表单上的每个参数添加一个集合:
// #1 Setup a collections
ParameterValues firstNameCollection = new ParameterValues();
ParameterValues lastNameCollectoin = new ParameterValues();
Run Code Online (Sandbox Code Playgroud)
然后我创建了实际参数:
// #2 Set the parameters
ParameterDiscreteValue firstNameParam = new ParameterDiscreteValue();
ParameterDiscreteValue lastNameParam = new ParameterDiscreteValue();
Run Code Online (Sandbox Code Playgroud)
绑定值:
// #3 Set the values
firstNameParam.Value = "First Name";
lastNameParam.Value = "Last Name";
Run Code Online (Sandbox Code Playgroud)
将参数添加到集合中:
// #4 Add the parameters to the collection
firstNameCollection.Add(firstNameParam);
lastNameCollectoin.Add(lastNameParam);
Run Code Online (Sandbox Code Playgroud)
并将集合应用于表单:
// #5 Apply the collections to the report
MyReport.DataDefinition.ParameterFields["FirstName"].ApplyCurrentValues(firstNameCollection);
MyReport.DataDefinition.ParameterFields["LastName"].ApplyCurrentValues(lastNameCollectoin);
Run Code Online (Sandbox Code Playgroud) 这是:
between cast(date as date) and cast(date1 as date)
Run Code Online (Sandbox Code Playgroud)
同样如下:
between '01/01/01 00:00:00' and '01/01/01 11:59:59'
Run Code Online (Sandbox Code Playgroud)
我被告知,在比较SQL Server中的日期时间值时,如果我想返回PROPER结果,我应该总是包含一个带有我的日期的时间组件.