|
You're passing an empty DataSet to the update method.
You intialize companyDS as new and then never assign any data to it.
That's why there is no error. It is successfully updating with an empty DataSet into a database (that presumably) allows NULL values or empty strings.
|
|
|
|
|
Okay cool...will you show me how to do it????
I think I would need a dataset.table variable and then assign it the data of the current row, and then pass that to the tableadapter.update() is this right?
can you show me how you would do it in some code. I have 4 tables in my dataset.
Dataset = WinVoiceDataSet
Table = Company
Christopher J. Thornburg
|
|
|
|
|
Hi ,
How in C# .NET find the position of specifig image (saved for example in Bitmap) on the screen ?
Life would be much easier if we just could look at the source code
|
|
|
|
|
If you already know the exact bitmap you want to find, you can do a screen capture, then look for an exact pixel match from there. I don't recall how to do the screen capture, but I know there's support for it. You would use code like that in my image processing articles to turn the two bitmaps into byte arrays and go looking for the scanline that represents the top of the bitmap.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
I suspect you can copy it from Screens.PrimaryScreen ( or whatever it's called ).
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
In a very short amount of time I need to cause severe fragmentation on a volume on my system. I have found a bug in my program that is directly related to a volume being defragged. I would like a tool that will allow me to control the fragmentation of a volume then turn around and run the defragger.
Is there anyone who can help me with this? I need to cause fragmentation on any given volume on most OS’s from XP through Longhorn.
Thank you,
Matt Rowe
|
|
|
|
|
I doubt anyone has ever written a tool to make your volume fragmented.
There's API support to DEFRAG a volume, but not fragment it.
There are two approaches to this. Make a sector-by-sector image of a disk that is already fragmented and reload your stuff on it to test. When your test is complete you can restore the image and put everything back where it was.
Randomly create and delete thousands of files of various sizes on the volume to fragment the writing of those files. Leave some in place and delete others.
You cannot "cause fragmentation" of existing files on the volume without rewriting those files and moving individual blocks of data in those files to other locations on the disk. This would require "blackbelt" level knowledge of the NTFS file system and it's API's to accomplish.
|
|
|
|
|
Thank you for your feed back. I will give it a try.
|
|
|
|
|
Hi,
this is what I would suggest, it is not very hard to do:
1.
create a disk partition (with Partition Magic or something similar) of twice the minimal size
that will fit your needs (this speeds up what follows). Make sure it is empty to start with.
2.
create a lot of files of equal small size until your partition is full; give them sequential
filenames (such as A00000000.dat and counting up). small would be say 8KB (I would suggest
you take partition size divided by 64K and rounded up to the next power of 2
multiple of 512B, to try and get the cluster size).
3.
now delete half of those files (the ones with an even filename);
that should result in the most fragmented partition possible: half of the partition is
empty, but a file of that size would have all its clusters non-adjacent.
4.
now run your real app and see what happens...
BTW: I would do steps 2,3,4 separately so you can inspect the situation to make sure
the situation is as expected.
Hope this helps.
-- modified at 22:49 Tuesday 25th September, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thank you for you suggestion. I a similar approach, but on vista I ended up with only 2% fragmentation.
|
|
|
|
|
how can i subtract and multiply cells in datagridview in vs 2005 or even in the database...i want for example to add all the cells together and get the result...in short how to make math operations in ado.net applications using DatagridView or something...i hope my question is clear !!!
|
|
|
|
|
Just use the sum aggregate in an SQL query to sum all records. Example:
select sum(price) as total from articles
---
single minded; short sighted; long gone;
|
|
|
|
|
When I did that I did something like total += the cell value. I did that from RowAdded or RowDataBound. I can't remember the exact name, but every time a row is added the total would be increased by that cell's amount. Then I output that final value in the datagrid footer.
|
|
|
|
|
Essentially what I need to do is convert this code
<br />
CSSDBLIB.ImportClass DLImport = new ImportClass();<br />
DLImport.Files.Add(strFilePath);<br />
to code that uses reflection. I need this to be late-bound.
This is what I have so far
<br />
Type tDLImport = Type.GetTypeFromProgID("CSSDBLIB.Import");<br />
object DLImport = tDLImport.InvokeMember("Import",BindingFlags.CreateInstance, null, null, null);<br />
I can't figure out how to invoke the Add method of the Files property dynamically for this instance of the DLImport object.
???
Hope that makes sense.
Jared
|
|
|
|
|
First, you can't invoke a method on a property. A property is a method that returns or set something.
But you can invoke a method on the instance returned by the property getter, should you get an instance.
First you'll need to invoke the property getter which will be named
<br />
get_insertPropertyNameHere<br />
If an instance is returned from that call you can invoke the Add method on it.
I'm largely language agnostic
After a while they all bug me
|
|
|
|
|
Duh. What a brainfart! I was thinking about this all wrong. I have to do something like this.
<br />
object DLfiles = tImport.InvokeMember("Files", BindingFlags.GetProperty, null, DLImport, null);<br />
Type tImportFiles = Type.GetTypeFromProgID("CSSDBLIB.ImportFiles");<br />
tImportFiles.InvokeMember("Add", BindingFlags.InvokeMethod, null, DLfiles, new object[] { fullPath });<br />
|
|
|
|
|
Hi all..
Hi do I save a copy of XSD..I have a button called save that opens a savedialog. I want to save a copy of my current DataSet as a new file on a path chosen on the Save Dialog. Eg."c:\"29/03/43.xsd"".
Thanks is advance
Is this chair taken
|
|
|
|
|
Hello, I'm not sure about how to customize formats in strings.
I.e, I want a string that is an integer number, but with some zeros at the beginning to have a certain length.
So, if I have an integer value: i = 1, I want to convert it to string so it gets: "000001", with length 6.
I'm trying with i.ToString(), trying to guess which format to put to achieve that. Do you know the solution?
Regards,
Diego F.
|
|
|
|
|
I found other way to get that without the format method. I used the Padleft method and I get the same
Regards,
Diego F.
|
|
|
|
|
|
or ToString("D6");
analogous to ToString("X8"); for hex
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I was sure it was simple, but is soooo simple that I'm feeling embarrased
Regards,
Diego F.
|
|
|
|
|
This is a newbie question:
I have read lots of tutorials on how to add a datasource to project.
How to I cleanly remove a datasource or databindings from a project?
This has been a real pain for me. I have to spend a lot of time manually going through code to make sure all the references to these deleted form objects are removed.
Whats the best way?
TIA,
shwa guy.
|
|
|
|
|
The best way? You're already doing it. Since the designer cannot know what impact removing all of the references to the dataset would have on your code, it just doesn't touch it.
The absolute best way is to plan your data model more carefully so your not deleting datasources all the time.
|
|
|
|