I have bound the Text property of several Textboxes to the properties of an Object with DataSourceUpdateMode.Never.
A foreach loop cycles through all textboxes and the DataBindings.WriteValue() function is called for each modified textbox to give the changes back to the object (which stores them in a database):
foreach (TextBox ctrl in gbCAddress.Controls)
ctrl.Modified = false;
This works fine so far, but after calling WriteValue(), all other DataBindings reload the data from the object, which overwrites the changes made to the other textboxes (probably because the Datasource changed ?).
textbox1 and textbox2 were modified.
The loop calls the WriteValue() function for textbox1
All Bindings reload their data - textbox2.Text is now the old value
The loop calls the WriteValue() function for textbox2
Can I suppress this reloading somehow ? I cannot see why everything is reloaded after one field changes...
Is there a way to modify/add to the list of file extensions that ResXFileCodeGenerator recognizes as text files?
I'm on a project where the (DB2) queries are all accessed through resource files. I have a visual studio add-on that gives me editor support (color coding, etc) for working with DB2 queries when editing text files with the db2 extension.
The problem is that the ResXFileCodeGenerator doesn't recognize these files as being text files, so when I add them to the resource, they get returned as byte arrays.
I'm well aware that there are other, better ways to manage these queries, but I have to stay with the design that's already in place.
At this point all I want to do is make ResXFileCodeGenerator recognize files with a .db2 extension as text, so the ResourceManager will return them as strings.
Grim MCDBA, MCSD, MCP+SB
SELECT * FROM users WHERE clue IS NOT NULL
(0 row(s) affected)
I have a big size xml dom.
Each node has lots of sub node and each subnode has lots of child sub nodes.I want to read,validate and save this xml data to database.
How can i count a transaction while save xml data to database.
So I made a datagridview, table adaptor, dataset, etc and it's all working fine. I can view data perfectly but I can't save it. I tried doing this: Me.TerritoryTableAdapter.Adapter.Update(Me.TerritoryDataSet.Territory)
But it just says I need a DeleteCommand or UpdateCommand, etc. I'm using the ODBC driver for MySQL if it makes a difference. Please help
You must provide, or have autogenerated, the update, insert and delete commands so the DataAdapter can determine which one to call. You may know that you are only updating a record but to the DataAdpater there could inserts and deletes that need to be done also.
Create them youself. If you have complex statements the autogenerated ones aren't usually as efficient as ones you would create manually. Besides that, you should be using stored procs rather than manual sql statements.
Could anyone please help me with hiding the task bar when application runs. I did that with some code. But when I run another process from a button click, the task bar reappears. I want to disable the windows button too..
I have what amounts to a set of MS Word macros that I would like to test with automation. It's easy enough to start up word and drive it from my C# code using the Microsoft.Office.Interop.Word and System.Runtime.InteropServices.
One of the things I want to test is error conditions. The macro code will put up MsgBox dialogs with information if the input doesn't conform with my expected format. I would like my automation code to be informed when a dialog/msgbox is created so that negative tests can be performed.
The only thing I've found so far that might be able to do this is the windows hooks stuff by the cutting edge folks (http://msdn.microsoft.com/en-us/magazine/cc188966.aspx[^]).
This seems a little intrusive for what I need. I don't need to get in the call chain for a dialog, just need to be notified when one gets created. I've got to be missing something obvious.
The hook is the only way to get "notified" of the creation of a dialog.
The only other way to do it would be to constantly pool and use the GetWindow and FindWindow Win32 functions to get all of the windows in the system. Keep track of them, and scan again, comparing the new list of windows to the previous one. When you find a new window, there you go...
Thanks for the quick response, Dave. I'll quit looking for another way to do it then. I had been doing something similar to what you suggest (just polling with GetForegroundWindow and seeing when it changed to something unexpected) but it seemed like such a hack I thought I must be missing a better way.
Let's say I have a .NET 2.0 application that needs to load about 30 different .NET 2.0 assemblies during startup. Said application is taking about 35 seconds to cold-start and about 13 seconds to warm-start under a specific environment. I am aware that these numbers are fairly typical of .NET 2.0 applications. Our company did not develop said application, but am tasked with coming up with suggestions on how to improve the cold-start performance.
The reading I have done suggests that the difference in the two times is due to pages still being available in memory and not as many hard-faults (disk accesses) need to be performed to reload an assembly.
Things I have identified as potential solutions are:
1. Update the minimum hardware requirements (not sure what they currently are, but the tests above were done on a 1.8 GHz P4 with 512MB RAM). The cold-start time drops from 35 to 13 seconds on my development box which is a 3.0 GHz Dual Core with 2GB RAM. Warm-start time drops from 13 seconds to 3 seconds.
2. Update the application and all its assemblies to .NET 3.5. Any idea what improvement is this likely to achieve?
3. Generate native images for the assemblies. This is a trade-off between the time needed to load larger disk images and the time required to JIT-compile a CLR assembly. Is this worth pursuing further?
4. Rebase the assemblies. Using Process Explorer from SysInternals I observed that 30 assemblies were relocated by the OS Loader. Preliminary tests indicate that the performance improvement is negligible.
5. Preload the assemblies. What this would try to achieve is to mimic a warm-start, but I'm not sure how it would have to work. If I have a pre-loader application that loads the assemblies needed by the actual application, aren't different copies of the assemblies loaded by each application into its own AppDomain? How would this help improve cold-start performance unless the assemblies are put in a common place? As you can see I'm a little confused. Help?
to my c#.net 3.5 application i added a setup project. setup created successfully and running fine.
but when am trying to install in a computer where there is no .net 3.5 framework it is asking in window that 'This setup requires the .NET framework 3.5. please install .net framework and run this setup again. The .NET Framework can be obtained from the web. Would you like to do this now?' with Yes and No buttons.
but in my setup project Prequisites property i selected .Net freamework2.0, 3.5 and window installer 3.1
and i selected 2nd radiobutton that is Download prerequisites from the same location as my application.
i build it successfully i got respective folders in to my debug folder.
but during the installation it is not installing automatically that .net framework3.5
forcefully am going to install framework.
Look, you've been failing at this for over a week now. If you have not yet read the documentation I strongly advise you to do so. If you have read it and you still have this ridiculously unintelligent understanding of how this will work then you are not qualified to be doing this job.