Search Results

Search found 1402 results on 57 pages for 'dataset'.

Page 38/57 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • Testing Entity Framework applications, pt. 3: NDbUnit

    - by Thomas Weller
    This is the third of a three part series that deals with the issue of faking test data in the context of a legacy app that was built with Microsoft's Entity Framework (EF) on top of an MS SQL Server database – a scenario that can be found very often. Please read the first part for a description of the sample application, a discussion of some general aspects of unit testing in a database context, and of some more specific aspects of the here discussed EF/MSSQL combination. Lately, I wondered how you would ‘mock’ the data layer of a legacy application, when this data layer is made up of an MS Entity Framework (EF) model in combination with a MS SQL Server database. Originally, this question came up in the context of how you could enable higher-level integration tests (automated UI tests, to be exact) for a legacy application that uses this EF/MSSQL combo as its data store mechanism – a not so uncommon scenario. The question sparked my interest, and I decided to dive into it somewhat deeper. What I've found out is, in short, that it's not very easy and straightforward to do it – but it can be done. The two strategies that are best suited to fit the bill involve using either the (commercial) Typemock Isolator tool or the (free) NDbUnit framework. The use of Typemock was discussed in the previous post, this post now will present the NDbUnit approach... NDbUnit is an Apache 2.0-licensed open-source project, and like so many other Nxxx tools and frameworks, it is basically a C#/.NET port of the corresponding Java version (DbUnit namely). In short, it helps you in flexibly managing the state of a database in that it lets you easily perform basic operations (like e.g. Insert, Delete, Refresh, DeleteAll)  against your database and, most notably, lets you feed it with data from external xml files. Let's have a look at how things can be done with the help of this framework. Preparing the test data Compared to Typemock, using NDbUnit implies a totally different approach to meet our testing needs.  So the here described testing scenario requires an instance of an SQL Server database in operation, and it also means that the Entity Framework model that sits on top of this database is completely unaffected. First things first: For its interactions with the database, NDbUnit relies on a .NET Dataset xsd file. See Step 1 of their Quick Start Guide for a description of how to create one. With this prerequisite in place then, the test fixture's setup code could look something like this: [TestFixture, TestsOn(typeof(PersonRepository))] [Metadata("NDbUnit Quickstart URL",           "http://code.google.com/p/ndbunit/wiki/QuickStartGuide")] [Description("Uses the NDbUnit library to provide test data to a local database.")] public class PersonRepositoryFixture {     #region Constants     private const string XmlSchema = @"..\..\TestData\School.xsd";     #endregion // Constants     #region Fields     private SchoolEntities _schoolContext;     private PersonRepository _personRepository;     private INDbUnitTest _database;     #endregion // Fields     #region Setup/TearDown     [FixtureSetUp]     public void FixtureSetUp()     {         var connectionString = ConfigurationManager.ConnectionStrings["School_Test"].ConnectionString;         _database = new SqlDbUnitTest(connectionString);         _database.ReadXmlSchema(XmlSchema);         var entityConnectionStringBuilder = new EntityConnectionStringBuilder         {             Metadata = "res://*/School.csdl|res://*/School.ssdl|res://*/School.msl",             Provider = "System.Data.SqlClient",             ProviderConnectionString = connectionString         };         _schoolContext = new SchoolEntities(entityConnectionStringBuilder.ConnectionString);         _personRepository = new PersonRepository(this._schoolContext);     }     [FixtureTearDown]     public void FixtureTearDown()     {         _database.PerformDbOperation(DbOperationFlag.DeleteAll);         _schoolContext.Dispose();     }     ...  As you can see, there is slightly more fixture setup code involved if your tests are using NDbUnit to provide the test data: Because we're dealing with a physical database instance here, we first need to pick up the test-specific connection string from the test assemblies' App.config, then initialize an NDbUnit helper object with this connection along with the provided xsd file, and also set up the SchoolEntities and the PersonRepository instances accordingly. The _database field (an instance of the INdUnitTest interface) will be our single access point to the underlying database: We use it to perform all the required operations against the data store. To have a flexible mechanism to easily insert data into the database, we can write a helper method like this: private void InsertTestData(params string[] dataFileNames) {     _database.PerformDbOperation(DbOperationFlag.DeleteAll);     if (dataFileNames == null)     {         return;     }     try     {         foreach (string fileName in dataFileNames)         {             if (!File.Exists(fileName))             {                 throw new FileNotFoundException(Path.GetFullPath(fileName));             }             _database.ReadXml(fileName);             _database.PerformDbOperation(DbOperationFlag.InsertIdentity);         }     }     catch     {         _database.PerformDbOperation(DbOperationFlag.DeleteAll);         throw;     } } This lets us easily insert test data from xml files, in any number and in a  controlled order (which is important because we eventually must fulfill referential constraints, or we must account for some other stuff that imposes a specific ordering on data insertion). Again, as with Typemock, I won't go into API details here. - Unfortunately, there isn't too much documentation for NDbUnit anyway, other than the already mentioned Quick Start Guide (and the source code itself, of course) - a not so uncommon problem with smaller Open Source Projects. Last not least, we need to provide the required test data in xml form. A snippet for data from the People table might look like this, for example: <?xml version="1.0" encoding="utf-8" ?> <School xmlns="http://tempuri.org/School.xsd">   <Person>     <PersonID>1</PersonID>     <LastName>Abercrombie</LastName>     <FirstName>Kim</FirstName>     <HireDate>1995-03-11T00:00:00</HireDate>   </Person>   <Person>     <PersonID>2</PersonID>     <LastName>Barzdukas</LastName>     <FirstName>Gytis</FirstName>     <EnrollmentDate>2005-09-01T00:00:00</EnrollmentDate>   </Person>   <Person>     ... You can also have data from various tables in one single xml file, if that's appropriate for you (but beware of the already mentioned ordering issues). It's true that your test assembly may end up with dozens of such xml files, each containing quite a big amount of text data. But because the files are of very low complexity, and with the help of a little bit of Copy/Paste and Excel magic, this appears to be well manageable. Executing some basic tests Here are some of the possible tests that can be written with the above preparations in place: private const string People = @"..\..\TestData\School.People.xml"; ... [Test, MultipleAsserts, TestsOn("PersonRepository.GetNameList")] public void GetNameList_ListOrdering_ReturnsTheExpectedFullNames() {     InsertTestData(People);     List<string> names =         _personRepository.GetNameList(NameOrdering.List);     Assert.Count(34, names);     Assert.AreEqual("Abercrombie, Kim", names.First());     Assert.AreEqual("Zheng, Roger", names.Last()); } [Test, MultipleAsserts, TestsOn("PersonRepository.GetNameList")] [DependsOn("RemovePerson_CalledOnce_DecreasesCountByOne")] public void GetNameList_NormalOrdering_ReturnsTheExpectedFullNames() {     InsertTestData(People);     List<string> names =         _personRepository.GetNameList(NameOrdering.Normal);     Assert.Count(34, names);     Assert.AreEqual("Alexandra Walker", names.First());     Assert.AreEqual("Yan Li", names.Last()); } [Test, TestsOn("PersonRepository.AddPerson")] public void AddPerson_CalledOnce_IncreasesCountByOne() {     InsertTestData(People);     int count = _personRepository.Count;     _personRepository.AddPerson(new Person { FirstName = "Thomas", LastName = "Weller" });     Assert.AreEqual(count + 1, _personRepository.Count); } [Test, TestsOn("PersonRepository.RemovePerson")] public void RemovePerson_CalledOnce_DecreasesCountByOne() {     InsertTestData(People);     int count = _personRepository.Count;     _personRepository.RemovePerson(new Person { PersonID = 33 });     Assert.AreEqual(count - 1, _personRepository.Count); } Not much difference here compared to the corresponding Typemock versions, except that we had to do a bit more preparational work (and also it was harder to get the required knowledge). But this picture changes quite dramatically if we look at some more demanding test cases: Ok, and what if things are becoming somewhat more complex? Tests like the above ones represent the 'easy' scenarios. They may account for the biggest portion of real-world use cases of the application, and they are important to make sure that it is generally sound. But usually, all these nasty little bugs originate from the more complex parts of our code, or they occur when something goes wrong. So, for a testing strategy to be of real practical use, it is especially important to see how easy or difficult it is to mimick a scenario which represents a more complex or exceptional case. The following test, for example, deals with the case that there is some sort of invalid input from the caller: [Test, MultipleAsserts, TestsOn("PersonRepository.GetCourseMembers")] [Row(null, typeof(ArgumentNullException))] [Row("", typeof(ArgumentException))] [Row("NotExistingCourse", typeof(ArgumentException))] public void GetCourseMembers_WithGivenVariousInvalidValues_Throws(string courseTitle, Type expectedInnerExceptionType) {     var exception = Assert.Throws<RepositoryException>(() =>                                 _personRepository.GetCourseMembers(courseTitle));     Assert.IsInstanceOfType(expectedInnerExceptionType, exception.InnerException); } Apparently, this test doesn't need an 'Arrange' part at all (see here for the same test with the Typemock tool). It acts just like any other client code, and all the required business logic comes from the database itself. This doesn't always necessarily mean that there is less complexity, but only that the complexity happens in a different part of your test resources (in the xml files namely, where you sometimes have to spend a lot of effort for carefully preparing the required test data). Another example, which relies on an underlying 1-n relationship, might be this: [Test, MultipleAsserts, TestsOn("PersonRepository.GetCourseMembers")] public void GetCourseMembers_WhenGivenAnExistingCourse_ReturnsListOfStudents() {     InsertTestData(People, Course, Department, StudentGrade);     List<Person> persons = _personRepository.GetCourseMembers("Macroeconomics");     Assert.Count(4, persons);     Assert.ForAll(         persons,         @p => new[] { 10, 11, 12, 14 }.Contains(@p.PersonID),         "Person has none of the expected IDs."); } If you compare this test to its corresponding Typemock version, you immediately see that the test itself is much simpler, easier to read, and thus much more intention-revealing. The complexity here lies hidden behind the call to the InsertTestData() helper method and the content of the used xml files with the test data. And also note that you might have to provide additional data which are not even directly relevant to your test, but are required only to fulfill some integrity needs of the underlying database. Conclusion The first thing to notice when comparing the NDbUnit approach to its Typemock counterpart obviously deals with performance: Of course, NDbUnit is much slower than Typemock. Technically,  it doesn't even make sense to compare the two tools. But practically, it may well play a role and could or could not be an issue, depending on how much tests you have of this kind, how often you run them, and what role they play in your development cycle. Also, because the dataset from the required xsd file must fully match the database schema (even in parts that otherwise wouldn't be relevant to you), it can be quite cumbersome to be in a team where different people are working with the database in parallel. My personal experience is – as already said in the first part – that Typemock gives you a better development experience in a 'dynamic' scenario (when you're working in some kind of TDD-style, you're oftentimes executing the tests from your dev box, and your database schema changes frequently), whereas the NDbUnit approach is a good and solid solution in more 'static' development scenarios (when you need to execute the tests less frequently or only on a separate build server, and/or the underlying database schema can be kept relatively stable), for example some variations of higher-level integration or User-Acceptance tests. But in any case, opening Entity Framework based applications for testing requires a fair amount of resources, planning, and preparational work – it's definitely not the kind of stuff that you would call 'easy to test'. Hopefully, future versions of EF will take testing concerns into account. Otherwise, I don't see too much of a future for the framework in the long run, even though it's quite popular at the moment... The sample solution A sample solution (VS 2010) with the code from this article series is available via my Bitbucket account from here (Bitbucket is a hosting site for Mercurial repositories. The repositories may also be accessed with the Git and Subversion SCMs - consult the documentation for details. In addition, it is possible to download the solution simply as a zipped archive – via the 'get source' button on the very right.). The solution contains some more tests against the PersonRepository class, which are not shown here. Also, it contains database scripts to create and fill the School sample database. To compile and run, the solution expects the Gallio/MbUnit framework to be installed (which is free and can be downloaded from here), the NDbUnit framework (which is also free and can be downloaded from here), and the Typemock Isolator tool (a fully functional 30day-trial is available here). Moreover, you will need an instance of the Microsoft SQL Server DBMS, and you will have to adapt the connection strings in the test projects App.config files accordingly.

    Read the article

  • CodePlex Daily Summary for Sunday, June 24, 2012

    CodePlex Daily Summary for Sunday, June 24, 2012Popular ReleasesXDA ROM HUB: XDA ROM HUB v0.9: Kernel listing added -- Thanks to iONEx Added scripts installer button. Added "Nandroid On The Go" -- Perform a Nandroid backup without a PC! Added official Android app!ExtAspNet: ExtAspNet v3.1.8: +2012-06-24 v3.1.8 +????Grid???????(???????ExpandUnusedSpace????????)(??)。 -????MinColumnWidth(??????)。 -????AutoExpandColumn,???????????????(ColumnID)(?????ForceFitFirstTime??ForceFitAllTime,??????)。 -????AutoExpandColumnMax?AutoExpandColumnMin。 -????ForceFitFirstTime,????????????,??????????(????????????)。 -????ForceFitAllTime,????????????,??????????(??????????????????)。 -????VerticalScrollWidth,????????(??????????,0?????????????)。 -????grid/grid_forcefit.aspx。 -???????????En...AJAX Control Toolkit: June 2012 Release: AJAX Control Toolkit Release Notes - June 2012 Release Version 60623June 2012 release of the AJAX Control Toolkit. AJAX Control Toolkit .NET 4 – AJAX Control Toolkit for .NET 4 and sample site (Recommended). AJAX Control Toolkit .NET 3.5 – AJAX Control Toolkit for .NET 3.5 and sample site (Recommended). Notes: - The current version of the AJAX Control Toolkit is not compatible with ASP.NET 2.0. The latest version that is compatible with ASP.NET 2.0 can be found here: 11121. - Pages using ...WPF Application Framework (WAF): WPF Application Framework (WAF) 2.5.0.5: Version: 2.5.0.5 (Milestone 5): This release contains the source code of the WPF Application Framework (WAF) and the sample applications. Requirements .NET Framework 4.0 (The package contains a solution file for Visual Studio 2010) The unit test projects require Visual Studio 2010 Professional Changelog Legend: [B] Breaking change; [O] Marked member as obsolete WAF: Add IsInDesignMode property to the WafConfiguration class. WAF: Introduce the IModuleController interface. WAF: Add ...Windows 8 Metro RSS Reader: Metro RSS Reader.v7: Updated for Windows 8 Release Preview Changed background and foreground colors Used VariableSizeGrid layout to wrap blog posts with images Sort items with Images first, text-only last Enabled Caching to improve navigation between frames This is the release package of the source code The package includes x64, x86 releases. Installation Instructions http://dl.dropbox.com/u/23484650/RssReaderMetro/Screenshots/AppPackage.JPG Select x64 or x86 folder from the package http://dl.dropbox.com...Confuser: Confuser 1.9: Change log: * Stable output (i.e. given the same seed & input assemblies, you'll get the same output assemblies) + Generate debug symbols, now it is possible to debug the output under a debugger! (Of course without enabling anti debug) + Generating obfuscation database, most of the obfuscation data in stored in it. + Two tools utilizing the obfuscation database (Database viewer & Stack trace decoder) * Change the protection scheme -----Please read Bug Report before you report a bug-----...XDesigner.Development: First release: First releaseBlackJumboDog: Ver5.6.5: 2012.06.22 Ver5.6.5  (1) FTP??????? EPSV ?? EPRT ???????DotNetNuke® Form and List: 06.00.01: DotNetNuke Form and List 06.00.01 Changes in 06.00.01 Icons are shown in module action buttons (workaraound to core issue with IconAPI) Fix to Token2XSL Editor, changing List type raised exception MakeTumbnail and ShowXml handlers had been missing in install package Updated help texts for better understanding of filter statement, token support in email subject and css style Major changes for fnL 6.0: DNN 6 Form Patterns including modal PopUps and Tabs http://www.dotnetnuke.com/Po...MVVM Light Toolkit: V4RTM (binaries only) including Windows 8 RP: This package contains all the latest DLLs for MVVM Light V4 RTM. It includes the DLLs for Windows 8 Release Preview. An updated Nuget package is also available at http://nuget.org/packages/MvvmLightLibs An installer with binaries, snippets and templates will follow ASAP.Weapsy - ASP.NET MVC CMS: 1.0.0: - Some changes to Layout and CSS - Changed version number to 1.0.0.0 - Solved Cache and Session items handler error in IIS 7 - Created the Modules, Plugins and Widgets Areas - Replaced CKEditor with TinyMCE - Created the System Info page - Minor changesAcDown????? - AcDown Downloader Framework: AcDown????? v3.11.7: ?? ●AcDown??????????、??、??????。????,????,?????????????????????????。???????????Acfun、????(Bilibili)、??、??、YouTube、??、???、??????、SF????、????????????。 ●??????AcPlay?????,??????、????????????????。 ● AcDown??????????????????,????????????????????????????。 ● AcDown???????C#??,????.NET Framework 2.0??。?????"Acfun?????"。 ????32??64? Windows XP/Vista/7/8 ??:????????Windows XP???,?????????.NET Framework 2.0???(x86),?????"?????????"??? ??????????????,??????????: ??"AcDown?????"????????? ...NShader - HLSL - GLSL - CG - Shader Syntax Highlighter AddIn for Visual Studio: NShader 1.3 - VS2010 + VS2012: This is a small maintenance release to support new VS2012 as well as VS2010. This release is also fixing the issue The "Comment Selection" include the first line after the selection If the new NShader version doesn't highlight your shader, you can try to: Remove the registry entry: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors\Cache Remove all lines using "fx" or "hlsl" in file C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\CommonExtensions\Micr...3D Landmark Recognition: Landmark3D Dataset V1.0 (7z 1 of 3): Landmark3D Dataset Version 1.0Xenta Framework - extensible enterprise n-tier application framework: Xenta Framework 1.8.0: System Requirements OS Windows 7 Windows Vista Windows Server 2008 Windows Server 2008 R2 Web Server Internet Information Service 7.0 or above .NET Framework .NET Framework 4.0 WCF Activation feature HTTP Activation Non-HTTP Activation for net.pipe/net.tcp WCF bindings ASP.NET MVC ASP.NET MVC 3.0 Database Microsoft SQL Server 2005 Microsoft SQL Server 2008 Microsoft SQL Server 2008 R2 Additional Deployment Configuration Started Windows Process Activation service Start...MFCMAPI: June 2012 Release: Build: 15.0.0.1034 Full release notes at SGriffin's blog. If you just want to run the MFCMAPI or MrMAPI, get the executables. If you want to debug them, get the symbol files and the source. The 64 bit builds will only work on a machine with Outlook 2010 64 bit installed. All other machines should use the 32 bit builds, regardless of the operating system. Facebook BadgeMonoGame - Write Once, Play Everywhere: MonoGame 2.5.1: Release Notes The MonoGame team are pleased to announce that MonoGame v2.5.1 has been released. This release contains important bug fixes and minor updates. Recent additions include project templates for iOS and MacOS. The MonoDevelop.MonoGame AddIn also works on Linux. We have removed the dependency on the thirdparty GamePad library to allow MonoGame to be included in the debian/ubuntu repositories. There have been a major bug fix to ensure textures are disposed of correctly as well as some ...Sense/Net CMS - Enterprise Content Management: SenseNet 6.1 Community Edition: Sense/Net 6.1 Community EditionMain new features:major performance optimizations Office 2010 and Basic authentication support new main page and enhanced demo experience The new 6.1 release is a true milestone in the history of Sense/Net ECMS. In the past few months we mostly concentrated on performance optimizations and implemented low-level features for improved scalability and robustness. We have tested the system in high availability setup under high load by conducting a benchmark duri...????: ????2.0.2: 1、???????????。 2、DJ???????10?,?????????10?。 3、??.NET 4.5(Windows 8)????????????。 4、???????????。 5、??????????????。 6、???Windows 8????。 7、?????2.0.1???????????????。 8、??DJ?????????。Azure Storage Explorer: Azure Storage Explorer 5 Preview 1 (6.17.2012): Azure Storage Explorer verison 5 is in development, and Preview 1 provides an early look at the new user interface and some of the new features. Here's what's new in v5 Preview 1: New UI, similar to the new Windows Azure HTML5 portal Support for configuring and viewing storage account logging Support for configuring and viewing storage account monitoring Uses the Windows Azure 1.7 SDK libraries Bug fixesNew ProjectsAdvanced Wars By Snowstar: ????.....??join!Bible Mobile: The purpose of this project is to create a C#, ASP.NET, Microsoft SQL 2008 server Bible for mobile devices.Bitresolve: A simple CRUD based DB interaction - POC.blueChart: yet another android chart widgetsBulletProof In-App Youtube Video Playback for WP7 using SMF : POC: Want In-App Youtube video playback in your WP7 application? Want a bulletproof parsing solution? Check out this POC for In-App playback and peace of mind!CodeGenerate: The Project can auto generate C# code. Include BLL Layer、Domain Layer、IDAL Layer、DAL Layer. Support SqlServer And Oracle This is a alpha program,but which can contactus_pumpouts: contact us handler for pumpouts unlimitedCSV Serializer: The CsvSerializer provides functionality to define objects which can be (de)serialized to/from a CSV file. Parsing is per RFC4180.From the Farm to the Sandbox for SharePoint 2010: From the Farm to the Sandbox project focuses on unraveling the mysteries when converting a SharePoint 2010 farm solution to a sandbox with source and demos.Furtivue (providing a furtive view over your messages): Could be used for sending confidential/secret information (such as passwords), or any other data you don't want the receiver to keep permanently in their e-mailGPS Tracker System: GPS summary IIS Express Manager: IIS Express Manager (IISEM) will liberate you from visual studio/web matrix just to open your precious IIS Express hosted applications.Imagicus : A Simple Picture Gallery: This is a simple image viewer, which permits encrypted images. One cannot tell whether there are any hidden images, unless the special key is obtained. (Imaginem Porticus => Imagicus)Jason: Jason is an infrastructure framework to easly put the "Command" part of CQRS on top of WCFKartRanking - Sistema de controle de pontuação web de campeonato: Projeto com objetivo de desenvolver um sistema de controle de pontuação de um ou vários campeonato de kart online. KryschenApp: A Playstation Mobile App for the PS Vita. This app is for showing the german kryschen eMag on the ps vita.Ludos: Ludos is a collection several games written in java. It is a conglomeration of a variety of types of games, mostly non-graphic intensive.MSHelpMe: MS help me application in WP7MyTesting: trailNRuby: NRuby is a fork of IronRuby with the goal of kicking the project alive again and make Ruby on .NET a viable alternative for the masses.RandomRat: RandomRat is a program for generating random sets that meet specific criteriaResistance - Defender of Earth: sumShopping-Mail plugin for nopCommerce: This nopCommerce plugin integrates Shopping-Mail solution to share customers between merchant.Simple CMS: CMSes are often really a tease to integrate, and often offer more than needed. SimpleCMS is just simple.TestProject: auauTrading Terminal Suite: The Main purpose of project is to make programmatical interfaces for trading. The project uses Stock# framework and extends it in different ways. ünye fevzi çakmak: ilk denemeVS2012 ???????: VS2012 ???????

    Read the article

  • .NET ExcelLibrary Export Problems - .XLS corruption

    - by hamlin11
    The library is located here: http://code.google.com/p/excellibrary/ I'm using some basic code to create an .XLS file. When I open the file in Excel 2007, I get the following errors: I click yes, then I get: And just for fun, here's the XML error details (not very helpful) Here's the code that I'm using to generate the Excel file: Dim ds As New DataSet Dim dt1 As New DataTable("table 1") dt1.Columns.Add("column A", GetType(String)) dt1.Columns.Add("column B", GetType(String)) dt1.Rows.Add("test 1", "Test 2") dt1.Rows.Add("test 3", "Test 4") ds.Tables.Add(dt1) ExcelLibrary.DataSetHelper.CreateWorkbook("c:/temp/test1.xls", ds) Note: I added a reference to the DLL provided by the project download page and have an "Imports ExcelLibrary.Office.Excel" to link up with it Any ideas on what the corruption is and/or how to fix it? Thanks

    Read the article

  • RDLC filtering nested tables

    - by aprescott
    I am creating an RDLC report where the dataset consists of several datatables. There is one parent table and several child tables. What I would like to do is display relevant data from each child table for each row in the parent table. Here is a simplified example: table1 = "Purchase" has columns PurhcaseID, PurchaseNumber, PurchaseDate table2 = "PurchasedItem" has columns PurchaseItemID, PurhcaseID, ItemDescription In my RDLC, I have a Purchase table grouped on PurchaseDate and would like to display the PurchasedItems for each Purchase. The current solution uses a subreport, but I do not like this because it leaves an ugly empty space when there is no data for the subreport display. (I would be fine with using a subreport if I could properly hide it without leaving an empty space.) I am not able to rewrite the stored procedure to return a single table, either. How are others dealing with this scenario?

    Read the article

  • SSRS sum(distinct()) equivalent

    - by HurnsMobile
    I am currently working with an SSRS 2008 report that returns a dataset similar to the following: Job# ClientId MoneyIn MoneyOut ------------------------------ 1 ABC123 10 25 1 ABC123 10 25 1 ABC123 5 25 2 XYZ123 25 50 2 XYZ123 25 50 3 XYZ123 15 15 Where MoneyOut should be equal to the total amount of MoneyIn for a job if the job has been balanced out correctly. The problem that I am running into is when displaying this in a tablix in SSRS I can return the correct MoneyOut value for a job by setting the field to =first(Fields!MoneyOut.Value) but I also need to sum the value of these by day and attempting to do =sum(first(Fields!MoneyOut.Value)) yields an error about nesting aggregate functions. I've also attempted to sum the value of the textboxes using something like =sum(ReportItems!MoneyOut1.Value) which yields an error that you can only use aggregates on report items in the header or footer. So my question is, is there some way to duplicate the functionality of distinct() in SSRS reports or is there some way to just total up the values of text fields that I am unaware of? Thanks in advance, TJ

    Read the article

  • Fancy dynamic list in Android: TableLayout vs ListView

    - by Ralkie
    There is a requirement to have not-so-trivial dynamic list, each record of which consists of several columns (texts, buttons). It should look something like: Text11 Text12 Button1 Button2 Text21 Text22 Button1 Button2 ... At first obvious way to accomplish that seemed to be TableLayout. I was expecting to have layout/styling data specified in res/layout/*.xml and to populate it with some dataset from java code (as with ListView, for which its possible to specify TextView of item in *.xml and bind it to some array using ArrayAdapter). But after playing for a while, all I found to be possible is fully populating TableLayout programatically. Still, creating TableRow by TableRow and setting layout attributes directly in java code doesn't seem elegant enough. So the questions are: Am I at the right path? Is TableLayout really best View to accomplish that? Maybe it's more appropriate to extend ListView or something else to meet such requirements? Is it possible to have TableLayout/TableRow template specified in *.xml and data bound to this template in java side?

    Read the article

  • Updating a progress bar while wpf data binding is taking place (in c#)

    - by evan
    I bind a large dataset to a WPF list box which can take a long time (more than ten seconds). While the the data is being bound I'd like to display a circular progress bar I can't get the progress bar to show while the data binding is occurring, even though I am trying to do the binding in a backgroundworker. I tested it by making the first line of the backgroundworkd's dowork event a Thread.Sleep(5000) and sure enough the progress bar started spinning for that duration only to freeze while when the binding started. Is this because both the databinding and the UI updating have to occur on the same thread? Any ideas on how to work around it? Thanks for your help!!

    Read the article

  • Objective C ASIHTTPRequest nested GCD block in complete block

    - by T.Leavy
    I was wondering if this is the correct way to have nested blocks working on the same variable in Objective C without causing any memory problems or crashes with ARC. It starts with a ASIHttpRequest complete block. MyObject *object = [dataSet objectAtIndex:i]; ASIHTTPRequest *request = [[ASIHTTPRequest alloc]initWithURL:@"FOO"]; __block MyObject *mutableObject = object; [request setCompleteBlock:^{ mutableObject.data = request.responseData; __block MyObject *gcdMutableObject = mutableObject; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{ [gcdMutableObject doLongComputation]; dispatch_async(dispatch_get_main_queue(),^{ [self updateGUIWithObject:gcdMutableObject]; }); }); [request startAsynchronous]; My main concern is nesting the dispatch queues and using the __block version of the previous queue to access data. Is what I am doing safe?

    Read the article

  • Ado.net performance:What does SNIReadSync do?

    - by Beatles1692
    We have a query that takes 2 seconds to run in Sql Server Management Studio but it takes 13 seconds to be shown on a client screen. I used dotTrace to profile my source code and noticed there is this SNIReadSync method (part of ADO.net assemblies)that takes a lot of time to do its job(9 seconds).I ran my source over server so I could omit the network effects and the result was the same. It doesn't matter if I'm using OleDBConnection or SqlConnection. It doesn't matter if I'm using a DataReader or a DataSet. Connection pooling does not solve this issue(as my result shows). I googled this issue and I couldn't find an answer to the question that what this method is actually doing and how we can improve it. here's what I found on StakOverFlow that's not helpful either: http://stackoverflow.com/questions/1610874/snireadsync-executing-between-120-500-ms-for-a-simple-query-what-do-i-look-for

    Read the article

  • RDLC: How to print multiple tables in one report

    - by Eduardo Molteni
    I'm generating the RDLC XML schema and showing the report in the ReportViewer control. No problems there. Now, I want a report with 2 tables, with 2 differents dataset. Something like this gets generated: <Body> <ReportItems> <Table Name="Table1"> .... </Table> <Table Name="Table2"> .... </Table> </ReportItems> </Body> But, when printed, both tables start from the top, printing one table over the other (not nice) Is there a way to tell that Table2 should start after Table1? Update: I've tried with List with a fake DataSource, but it does not work.

    Read the article

  • EFCreateError with JvCsvDataSet

    - by Kim Jensen
    I have been using JvCSVDataSet with Delphi 5 and it works fine. I just moved over to Delphi 2007 and now with the same program I get EFCreateError, cannot create file "" I got the error description from MAdexcept 3.0. Here are the code,I get the error in the line 'CADDCOUNT', but if I rem out that line then I don't get the error before I close the dataset. jvCsvDataSet1.FileName := 'C:\TEST.CSV'; jvCsvDataSet1.SaveToFile('C:\TEST.CSV'); jvCsvDataSet1.Active := True; jvCsvDataSet1.Append; jvCsvDataSet1.FieldByName('LINETYPE').Asstring := 'VERSION"; jvCsvDataSet1.FieldByName('CADDCOUNT').AsString := 'Company Name and address'; jvCsvDataSet1.Post; jvCsvDataSet1.Active := False; Thanks, for any help. Kim

    Read the article

  • Error reading in date using Zoo in R

    - by SASnewby
    I am trying to use the Zoo package to read in daily observations which do not occur on each day. The date format looks like this, and it is in the first column of dataset: 25-May-07 The command I use is: z <- read.zoo("multiplier7.csv", sep = ";", header = TRUE, format="%d-%b-%y") I get this error: Error in strptime(x, format, tz = "GMT") : input string is too long First question is: 1. Is Zoo the right package to use if I want to use lm regression with a spline time dummy? The bs command does not work because I need to convert it into a time series. 2. Why is this error occurring and how to fix?

    Read the article

  • Comparing Dates in LINQ and C#

    - by Redburn
    I have a LINQ query which checks to see if there are any tests done since the beginning of the year. var MetersTestedCount = (from n in _mttDomainContext.MTTMeterTests where n.TestDate > DateTime.Parse("1/1/2010") select n.TestDate).Count(); This query however returns an empty set. I have a similar SQL query which pulls some records, USE MeterTestTracking Select * From MTTMeterTest WHERE TestDate > '1/1/2010' I have been to the previous posts. Even though similar, still no help: How to compare just the date, not the timestamp using LINQ and How to compare dates in LINQ? What's the correct way to check dates in LINQ to return a dataset?

    Read the article

  • SSRS 2005: Filter Nested Table within a List

    - by Even Mien
    In SQL Server Reporting Services 2005, how can I filter a nested table within a list? I have 2 datasets. The first, datasetHeader, contains one row per account. The second, datasetDetails contains multiple rows per account. Control: Dataset name List: datasetHeader Table: datasetDetails The table is placed within the list. When I attempt to filter on the table, I get fields from datasetHeader instead of datasetDetails. Previously I had the table within a subreport, and I had that working by using parameters; however, I needed to pull it into the main report because of the implied KeepTogether=true property for subreports that was causing undesired pagination.

    Read the article

  • Graphing perpendicular offsets in a least squares regression plot in R

    - by D W
    I'm interested in making a plot with a least squares regression line and line segments connecting the datapoints to the regression line as illustrated here in the graphic called perpendicular offsets: http://mathworld.wolfram.com/LeastSquaresFitting.html I have the plot and regression line done here: ## Dataset from http://www.apsnet.org/education/advancedplantpath/topics/RModules/doc1/04_Linear_regression.html ## Disease severity as a function of temperature # Response variable, disease severity diseasesev<-c(1.9,3.1,3.3,4.8,5.3,6.1,6.4,7.6,9.8,12.4) # Predictor variable, (Centigrade) temperature<-c(2,1,5,5,20,20,23,10,30,25) ## Fit a linear model for the data and summarize the output from function lm() severity.lm <- lm(diseasesev~temperature,data=severity) # Take a look at the data plot( diseasesev~temperature, data=severity, xlab="Temperature", ylab="% Disease Severity", pch=16 ) abline(severity.lm,lty=1) title(main="Graph of % Disease Severity vs Temperature") Should I use some kind of for loop and segments http://www.iiap.res.in/astrostat/School07/R/html/graphics/html/segments.html to do the perpendicular offsets? Is there a more efficient way? Please provide an example if possible.

    Read the article

  • SQLCEException was unhandled: Internal Error: Cannot open the shared memory region

    - by dwaz
    I am trying to do a TableAdapter.Fill(dataTable) and it fails with the above error. Here is the code in Zenware.DataSet.Designer.cs [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)] public virtual int Fill(ZenwareDataSet.BatchPDADataTable dataTable) { this.Adapter.SelectCommand = this.CommandCollection[0]; if ((this.ClearBeforeFill == true)) { dataTable.Clear(); } int returnValue = this.Adapter.Fill(dataTable); // <---Fails here. return returnValue; } This is generated code. Maybe there is something that I need to change? I am wondering if my app has multiple connections to the database. What can this be? Thanks for any help you can provide. Windows Mobile 6.1 device (Trimble Juno SB) SQLServerCompact 3.5 Service Pack 2 Microsoft .NET CF 3.5

    Read the article

  • C# Modify Connection String that exists inside a library

    - by LnDCobra
    I have a Class Library, which inside just has a DataSet (MySQL connector) and a Connector class. I use this class in multiple projects to connect to the database, and I always had the password embedded in the connection string but now I need to be able to modify this string(for security purposes) so I can have the user connect using their own account. How can I modify this connection string. I have tried the following Properties.Settings.Default.DataBaseConnectionString = "String"; But it seems that the connection string is readonly becase it doesn't appear to have a setter value. I also tried the following with no luck Properties.Settings.Default.DatabaseConnectionString.Insert( Properties.Settings.Default.DatabaseConnectionConnectionString.Length - 1, "Password=dbpassword;");

    Read the article

  • Entity Framework and consuming a WCF service

    - by nakori
    I'm getting data where the database is hidden behind a WCF service. Is it possible to use Entity Framework in a scenario where I have custom objects coming from a web service? (No access to the external database, and no current plans for insert/update/delete logic) Starting with an empty EF model and adding an entity I get this error on compile: No mapping specified for instances of the EntitySet and AssociationSet in the EntityContainer .. Is it possible to make an entity this way, and fill it with data received from an object? (In this case a WCF, but could also be a predefined model class/xml data) If the web service retured a Customer object I could do something like this with a dataset: Make an unbound table and do a loop through the customer properties adding them to a temp row, add it with tbl_Customer.Addtbl_CustomerRow(customerRow) to get my view filled. thanks, nakori

    Read the article

  • Are TClientDataSets part of your toolkit, or have they been replaced by something else?

    - by Tom1952
    I have 50 or 60 records of four or five fields. I need to load the records into RAM (From a CSV file), search on different fields, enumerate, etc. Not a lot of data, not a lot of functionality. I was all excited to use the new (to me in D2010) TDictionary or TList, but thought that a TClientDataset (which I've never used before) might be more appropriate. With a TClientDataSet, I can use .Locate on any field, enumerate with while NOT CDS.EOF, etc. And, what exactly is this MidasLib that I have to use with CDS? Can I reasonably expect it to be supported in the future? Is TClientDataSet still considered state-of-the-art, or is it showing its age and somewhat deprecated (literally and figuratively)? I've seen colleagues use DX's TdxMemData. Why use it (or any of the other handful of memory datasets I've seen while googling this issue) rather than a CDS? Related question: http://stackoverflow.com/questions/274958/delphi-using-tclientdataset-as-an-in-memory-dataset

    Read the article

  • Algorithm to generate numerical concept hierarchy

    - by Christophe Herreman
    I have a couple of numerical datasets that I need to create a concept hierarchy for. For now, I have been doing this manually by observing the data (and a corresponding linechart). Based on my intuition, I created some acceptable hierarchies. This seems like a task that can be automated. Does anyone know if there is an algorithm to generate a concept hierarchy for numerical data? To give an example, I have the following dataset: Bangladesh 521 Brazil 8295 Burma 446 China 3259 Congo 2952 Egypt 2162 Ethiopia 333 France 46037 Germany 44729 India 1017 Indonesia 2239 Iran 4600 Italy 38996 Japan 38457 Mexico 10200 Nigeria 1401 Pakistan 1022 Philippines 1845 Russia 11807 South Africa 5685 Thailand 4116 Turkey 10479 UK 43734 US 47440 Vietnam 1042 for which I created the following hierarchy: LOWEST ( < 1000) LOW (1000 - 2500) MEDIUM (2501 - 7500) HIGH (7501 - 30000) HIGHEST ( 30000)

    Read the article

  • pchart pie chart legend and graph not correlating

    - by madphp
    Hi, I have ten values in the dataset, numbers 1 - 10 and corresponding values. Some of the values are coming back as zero, so they are not added to the chart, BUT, the legend is still listing 1 - 10. Because theres values missing in the chart, the colour coding is knocked off. ie Item 1, has a value of zero, its passed over in the chart, the colour in the legend is red, Item 2, has a value of 4, the percentage is calculated, and the chart gives it the colour red which is the colour for item 1 in the legend. Hope that makes sense. How can I print the legend just for the values that are displayed in the chart? --Mark

    Read the article

  • Getting sectionNameKeyPath to work with CoreData/UITableViewController

    - by Elon
    In my AppDelegate I create an NSFetchedResultsController with sectionNameKeyPath set to @"group". In viewWillAppear in my TableViewController I performFetch, then call a method called findGroups. findGroups does some complicated analysis of the entire dataset to identify groups, then sets the "group" transient property on each object to the correct string value. I can see with NSLog that these are all set correctly and in coherent groups. But, tinker as I may, my cells are shown in a single section with the title of the first group. Any ideas?

    Read the article

  • Populate a combo box with one data tabel and save the choice in another.

    - by Scott Chamberlain
    I have two data tables in a data set for example lets say Servers: | Server | Ip | Users: | Username | Password | Server | and there is a foreign key on users that points to servers. How do I make a combo box that list all of the servers. Then how do I make the selected server in that combo box be saved in the data set in the Server column of the users table. EDIT -- I havent tested it yet but is this the right way? this.bsServers.DataMember = "Servers"; this.bsServers.DataSource = this.dataSet; this.bsUsers.DataMember = "FK_Users_Servers"; this.bsUsers.DataSource = this.bsServers; this.serverComboBox.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.bsUsers, "Server", true)); this.serverComboBox.DataSource = this.bsServers; this.serverComboBox.DisplayMember = "Server"; this.serverComboBox.ValueMember = "Server";

    Read the article

  • Can I programatically get hold of the Autos/local variables that is shown when debugging?

    - by Stefan
    Im trying to build an error-logger that loggs running values that is active in the function that caused the error. (just for fun so its not a critical problem) When going in break-mode and looking at the locals-tab and autos-tab you can see all active variables (name, type and value), it would be useful to get hold of that for logging purposes when an error occur and on some other occasions. For my example, I just want to find all local variables that are of type string and integer and store the name and value of them. Is this possible with reflection? Any tips or pointers that get me closer to my goal would be very appreciated. I have toyed with using expression on a specifik object (a structure) to create an automapper against a dataset, but I have not done anything like what I ask for above, so please make me happy and say its possible. Thanks.

    Read the article

  • Crystal report using Linq-to-sql

    - by DATT OZA
    Hello, I am bit confusing in generating crystal report from linq-to-sql object in my WpfApplication. crystalreport1 rpt = new crystalreport1(); datacontextclass1 db = new datacontextclass1(); var q = (from records in db.emp select records).toList(); rpt.setDataSource(q); crystalviewer.reportsource(rpt); I have done above steps... but its prompts error NotSupportedException Was Unhandled Dataset not support system.nullable< please help... thanx in advance..

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >