JIM.H.'s Q&A profile
Visual Studio Team System Unit Test Mocking - experiences
I'm currently looking at several Mocking tools to try and break various component dependancies when unit testing. So for example I want to unit test MyObject.SayHello(arg1) but that uses MyDataService.GetData(Request). When I unit test I don't want to actually want to invoke MyDataService but simply assume a return value. That way I can unit test only MyObject and not worry about any incorrect behaviour (or setup problems) from MyDataService. Looking at the options the majority of the Mocking objects work in the following fashion: MyUnitTest() MockObject("MyDataService.GetDate", "MyInputValue", "AssumedReturnValue"); MyObject.SayHello("Hello"); ..... What I really dislike about this ...Show All
Windows Forms How to display progress form as modal form
Hi, I am trying to use Backgroundworker, which is new in .net 2.0 Here is what I am trying to do.... I have a main form, in which I am filling data requested by a user. While getting the results , I want to display a modal dialog form with a progress bar in it. Once the main form's grid is filled with results close the progress form window. On click of GetResults button I have the following code BackgroundWorker bg = new BackgroundWorker (); bg.DoWork += delegate { GetRequestedData(txtbox.Text,records); }; bg.RunWorkerAsync( null ); ProgressForm pf = new ProgressForm (); pf.ShowDialog(); backgroundWorker1.RunWorkerCompleted += delegate { pf.Close(); }; With this approac ...Show All
Visual Studio Tools for Office Automatic update of VSTO application not working on Client machine but does work on Dev Machine
Hi - Our team were able to successfully test the automatic update process of their VSTO application (Outlook 2003) on the development server using the combination of PUBLISH of the Outlook project (on to some deployment server - Windows 2003) and the creation of the .MSI file on the Setup project. The .MSI when installed on this development machine, followed by the PUBLISH of the newer versions of the application on to a deployment server (File System option - Windows Server 2003) successfully pulls up the newer versions on to the local development machine when OUTLOOK is opened the next time. The issue is when the .MSI file is installed on the End User Machine. The .MSI file was installed and the application works fine. But the a ...Show All
Visual Studio 2008 (Pre-release) 3D performance in WPF
Hello I created a simple 3D model (there are two spheres in this model) with 3Ds max, exported it as 3ds file and then converted to XAML by using ZAM 3D. Then I inserted created viewport into a scene. I was using Daniel Lahenbauer's Tracball class for rotating around a model. When a model gets bigger (after zooming in), it starts to be hard to rotate around or to zoom in again, so the performance is bad. By the way, I have watched Daniel Lahenbauer's video about 3D integration into WPF on MSDN TV http://msdn.microsoft.com/msdntv/episode.aspx xml=episodes/en/20060504WPFDL/manifest.xml and there is a 3D globe demo. As I have seen, this demo has a posibility to move around the globe, and the performance is just great! So how to ma ...Show All
Windows Forms Best Windows Form Control to output data
I want to display a dataset to user and let user picks and chooses some of the data and output it to a printer or textfile. Is there a Windows form control that can let me do that DataGrid allows me to add and delete, but I need to choose and press a submit button to output the chosen data. Thanks. there really isnt a control to do this unless you make your own (custom control). I guess you can select the data you want (example: select the row index, then get all the details of the row via the datatable) then output it to the printer based on the row of data. ...Show All
SQL Server Accessing specific rows within a dataset
hi guys! i need to access a specific row within my dataset. how can this be done within a report my dataset looks like this 1 asdf 2 qwer 3 yxcv now i need to get the value for the 3rd row ("yxcv") or the value of row x i can only acces the first and last row by using First() and Last() but how can i access the rows inbetween Thanks, Gerhard Is there a reason you can't do a filter on the report based on the values that you are looking for, or in the query itself Otherwise the only other way I can fathom doing this is using the code module and writing a script that will manage which row/value you are looking at and only display it if it is equal to x. Although it might be intere ...Show All
Visual Basic Data vanishing during run time
When I enter data into a SQL database and save it, the data that I have just added vanishes, but when I close the applicaiton and re-open it, it's still there - is there any reason for this and any way to get it to stay Hi, Vanishes from where textboxes, labels More info needed please. Regards, S_DS ...Show All
SQL Server How can I compare datetime in a query???
I have a table with the following columns company_Id employee_id logon_time_id logoff_time start_valid_period end_valid_period Employee's working time should only be counted if it is between start_valid_period and end_valid_period So, if I have for employee1 from company1 logon_time_id = 04/07/2006 11:00 loggoff_time = 04/07/2006 12:20 start_valid_period = 04/07/2006 12:10 end_valid_period = 04/07/2006 12:30 I should consider 04/07/2006 12:10 as the initial datetime, 04/07/2006 12:20 as the final datetime, and count only 10min of work to him. In code: if(logon_time_id < start_valid_period) initialDatetime = start_valid_period else initialDatetime = logon_time_id if(logoff_time < end_valid_period) finalDateti ...Show All
Windows Forms How to toggle the highlighting on a row with every mouse click?
I'm trying to do the following in code-behind in C#: When a user clicks anywhere on a row, the row highlights in a different color. Another click on that same row changes the row to its original color. The user should be able to select multiple rows this way. The rows could be rows in ListView or DataGridView, currenttly I am trying DataGridView, havn't figured any possible ways. Please Help. webcliff This thread might help. Post at forums.asp.net to get a better answer... ...Show All
SQL Server rsParameterError
When trying to run a Report i'm getting a rsParameterError. But the same report on the same machine in th IDE works fine, all is running on a local developper machine. Where can i find details on what error occured, in the browser there is no extra details. In a reportserver log i can find the logging of the error, but no reason, or what query doesn't work ..... Any suggestions I guess you must be having some parameters which have default values fetched from a query. Can you set a static default value (from expression) and try again Shyam ...Show All
SQL Server sp problem
hi, See the follow scenario, table names in red. first field is pk, and same field names in other table are fk. now what i need to do is some rules when setting a bill to discarded, see last table. okay i need to do that via sp. the rule is simple: A bill can be discarded as long as it does not change the costing total on which it figures , that means it need to be replaced, this is something like a chain reaction. see the structure is broken, a bill is decomposed into a lot of bills, then distrubuted on a lot of purchase orders, and then ech purchase order can have multiple costings. Bill BillID Date_ SupplierCode BillType TypeCode Total Currency ROE payment_or_bill bill_detailed BillID_Detailed BillID AmountType Amo ...Show All
Microsoft ISV Community Center Forums vba create and add a macro for excel programmatically
Hi all I am currently traying to introduce into an excel spreadsheet a macro programatically. I have found examples on the net but they dont seem to work or they are for VB and not VBA. I was wondering perhaps someone knows how. I am currently generating many the excel spreasheets from through access vba. I am stuck when adding the macro to the sheets. They just dont seem to be there even though i save the data. Here are two examples i tried. The first one is VB so not a chance it will work but the second should and it doesnt. It does not give any errors or nothing. The excel sheets are created but no macro! hmmm EXAMPLE 1 myWrkb.VBProject.VBComponents.Add 1 'vbext_ct_StdModuleWith myWrkb.VBProject.VBComponents myWrkb.VBProje ...Show All
Visual C# Generics: trouble inferring type parameters from usage.
Hi everyone, Can anyone explain why the following code won't compile public static class Utilities { public delegate void Unary<T>( T t ); public delegate void Binary<First, Second>( First first, Second second ); public delegate void Tertiary<F, S, T>( F first, S second, T third); public static Unary<Second> BindFirst<First, Second>( Binary<First, Second> function, First first ) { return delegate( Second second ) { function( first, second ); }; } public static Binary<S, ...Show All
Visual C# STL.NET with type parametrization in C#
Hello, As I can see, at present there is no way to use STL.NET (cliext) in C#. We can only develop some typedef or class wrapper (with exact type instead of template!) in managed C++ and reference it in the C# project. And no type-parametrization can be organized due to STL.NET classes are templates, not generics. Or is there any tricky solution Thanks, Mae Kea , thanks for your reply. Sorry, maybe my question was too generalized : certainly, there are no straight ways to provide STL.NET templates to the C# generics. The main back-door possibility I'm considering is the MSIL-code dynamic compilation/modification. It means every time we need a generic type specialization in our C# program, engine ...Show All
.NET Development Why the difference between Access Query Configuration and Tableadapter Query Configuration Wizard
I have found that I can run a query using Access query builder works fine but the same query does not work in the "TableAdapter Query Configuration Wizard". Why is this Example: SELECT * from Rental_Agreement WHERE DateSerial(year(end_date), month(end_date) , day(end_date) - 5) = Date() This works in Acess 2003 but not in the "TableAdapter Query Configuration Wizard". Yes it was an Access table. The syntax was essentially the same as yours. You could also check the sandbox mode if the error is telling you that the function is unknown. It's stored in the Registry under the following key: \\HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\engines\SandboxMode The val ...Show All
