datasource

How To Pass a JRBeanCollectionDataSource to iReport?

╄→гoц情女王★ 提交于 2019-12-21 17:37:35
问题 I'm currently trying to use jasper to help me create reports. I have the information and data that I want displayed in this method: private void writeToFile(final List<ScenarioLoadModel> sceneLoadModel) throws Exception { final BufferedWriter bw = new BufferedWriter(new FileWriter("/Uma/nft/result.psv")); for (final ScenarioLoadModel slm : sceneLoadModel) { bw.write(slm.getScenarioId() + PSP + slm.getScenarioId() + PSP + slm.getScenarioConfig().getName() + PSP + slm.getLoad() + PSP + "" + EOL

What is the replacement for TestContext.DataRow[“MyColumnName”]

允我心安 提交于 2019-12-21 09:18:32
问题 Using MSTest in a .Net Core Unit test project. I am attempting to use a csv datasource to provide the data for a test method. Previously, I would use something like below in a .Net Framework test project: [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", @"data.csv", "data#csv", DataAccessMethod.Sequential), DeploymentItem("data.csv"), TestMethod] public void ValuesController_Post() { _controller.Post(TestContext.DataRow["body"]); _valuesRepository.Verify(_ => _.Post(It.IsAny

Bind DataTable to RDLC and ReportViewer

故事扮演 提交于 2019-12-21 05:22:13
问题 I have read every single SO question and online article regarding this, and I get confused in a couple different instances. As my project sits, I have tried to create a Report ( Report2.rdlc ) manually and drag different fields from DataSources onto the report, and use that report as the data source for the ReportViewer . This did not work. I need to use the DataTable I created from a SqlDataAdapter because it decrypts specific rows. I tried creating a DataSet and filling it with the

How to separate the selected item of two combobox with a single DataSource?

夙愿已清 提交于 2019-12-21 05:08:10
问题 On a form, I have two combobox wich have the same DataSource (their elements list are the same). When the user select an item in one of the control, the other control's selected item is also modified. That's not what I want. I'd like to have both list populated with the same DataSource (as I currently do), but I'd like their selected items to be independent from each other. How can I do that? 回答1: Or you could use... var dataSource = new[] { "item1", "item2", "item3" }; comboBox1.DataSource =

List<MyClass> as datasource for DropDownList?

只愿长相守 提交于 2019-12-21 04:56:26
问题 I have a simple Class with ID and Name on it which I would like to link to a DropDownList but it seems that myDropDownList.DataTextField = "Name"; and myDropDownList.DataValueField = "ID"; are not accessible or available. UPDATE: I am using winforms public class Test { public int ID { get; set; } public string Name { get; set; } } List<Test> myList = new List<Test>() { // bla bla bla some entries bla bla bla you got the point. }; myDropDownList.DataSource = myList; I know I could override

Programmatically setting grid sort

旧城冷巷雨未停 提交于 2019-12-20 18:39:52
问题 Is it possible to programmatically set the sort parameter of a KendoUI DataSource before reading data and avoiding a second server reading? The scope is setting a default sort on a certain user interaction. How? Here is an example of what I am trying to do, because the answers are not getting to the point (or maybe I am not understanding how things work). I define a Kendo DataSource with an initial sort: var datasource = new kendo.data.DataSource({ parameterMap: function (inputParams,

kendo ui grid datasource filter date format

送分小仙女□ 提交于 2019-12-20 12:41:01
问题 I have a kendo grid with a date field in the datasource. When displaying the field I use a template to display the date in the UK date format 'dd/MM/yyyy'. The problem is when filtering, I don't know how to display the date filter in UK format. Another problem I am having is there is no datetime type, just date, so can only filter by dates not datetimes. Any help or ideas would be appreciated. This is the partial view (cshtml) <script type="text/javascript"> $(document).ready(function() { var

spring add datasource at runtime

怎甘沉沦 提交于 2019-12-20 10:46:12
问题 I am working on a spring boot multi-tenant application with database per tenant strategy. Requirement is that to add new databases at runtime which means I have to create new datasource objects dynamically. I also looked upon Spring's AbstractRoutingDataSource but in needs pre-defined datasources. So I just want to know how to add/remove datasource without restarting application server. Thanks in advance. 回答1: I finally managed to get things working straight. For someone having same issue,

I have a 2d (n x n) string array in C#, how do I get it ouputted to a webpage dynamically (Tried DataTables/Binding, etc…)

跟風遠走 提交于 2019-12-20 05:28:33
问题 I have an n by n String array that needs to be outputted to a web page, I have found some solutions that require many many (read: many) lines of code (usually converting it to a DataTable then binding to a GridView). And almost all of these solutions will not even work for the dynamic nature of my arrays (I do not know ahead of time how many columns and rows are going to be generated, nor the names of the columns: it's user controlled). I find this to all of these solutions to be somewhat

How to properly close datasource connection?

坚强是说给别人听的谎言 提交于 2019-12-19 17:52:46
问题 I have this class but Im not sure on how to properly close connection because Im still having this error even though I only have 3 users logged in but with multiple sql queries. > com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: > Data source rejected establishment of connection, message from > server: "Too many connections" import java.io.File; import java.io.IOException; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import