Ok thanks, I didn't think so but was worried there for a moment.
I think I've decided the best bet is to just store a "size" column in my table(s) and compute the length of the data in code before I insert/update the row. This will give me a rough idea of how much space a given row will use, at least compared to other rows.
User Profile
Collapse
-
It appears this method only returns the maximum size of a column, not how much space a particular row is actually using in that column... unless I'm way off and unused space in a varchar is actually wasted.
Is that the case? If I have a nvarchar(4000) column, and store a string of 10 characters, will there be 3990 bytes wasted in the database file for that row? I was kind of under the assumption that things would be a little more ...Leave a comment:
-
Determine the byte size of a particular row?
Hi, I'm wondering if anyone knows how to determine the physical size of a particular row in a table. I suppose I could figure this out manually by determining the length of all fields, but was wondering if there's a built-in way to do this.
I'm actually using SQL Server Compact, but am interested in whether it's possible on any platform.
Thanks.
P.S.
I realize there are additional things like index... -
Drawing international characters
Hi. I'm writing an RSS reader and have just discovered it doesn't work with international characters. I'm handling UTF-8 just fine and can handle extended "special" characters, like accents and so on, but for some reason I cannot draw Chinese characters.
Here's the low-down:
I set a breakpoint to check the internal value of a string, which, when I view it using the VS2005 string viewer, shows the proper Chinese... -
-
Make a form behave like a menu
Hi. Does anyone know how to make a windows form behave like a menu, such that it closes if the user clicks anywhere away from it?
It would also be nice if the window didn't steal the focus from the parent form, but this isn't necessary. -
Haha, FeedBeast is my app. :)
...another thing is that it seems to happen randomly and I have as yet been unable to reproduce it reliably. I wonder if perhaps it is a threading/concurrency issue.Leave a comment:
-
Mysterious Serialization error
I am getting the following exception:
Type 'Ross.ListViewe r' in Assembly 'FeedBeast, Version=1.0.1.0 , Culture=neutral , PublicKeyToken= d816ce10916cb18 5' is not marked as serializable.
...when I call Settings.Defaul t.Save() using the built-in VS settings class.
However the problem is nowhere am I saving an object of type ListViewer to the settings! Why on earth would I be getting this exception and what... -
Ok I think I've come up with a solution. It involves showing the cleanup dialog in the FormClosing event as before, but this time I'm closing the window before calling Application.Exi t(). In fact, I don't even need to call Application.Exi t at all, since closing the main form of the application has the same effect.
However I did have to set a little flag that indicates the form should in fact close, because I also happen to have a "close...Leave a comment:
-
-
But this does not account for things like system shutdown, which I would also like for the cleanup operation to occur for, as does Outlook.
It seems to me there must be a way to do it without changing the Exit() call, or perhaps cancelling the exit altogether. I'm going to try that...Leave a comment:
-
Showing a form after Application.Exit()... :@!!!
It almost seems as though Microsoft wants it to be illegal to show a form after the user chooses Application.Exi t, yet that is exactly what I need to do.
I have a cleanup routine that deletes old articles from a database, and like to show a progress dialog while this is happening, just like Outlook's emptying deleted items dialog.
However, no matter what I try it won't work! Basically my first attempt was to simply show... -
ADO.NET DataAdapter.Update taking forever
Hi. I'm using SQL Server Compact Edition with Ado.net and have a serious performace issue I'd like to clear up.
The problem in it's simplest form is that I load say 2,000 rows from a table in the database (which may contain many thousands of rows) into a DataTable. I then select a bunch of these (say 1500) that meet some criteria and Delete() them via their DataRow objects. Note that this all happens relatively quickly.
... -
Ok guys, this is the best I've come up with, and to be quite honest I'm hardly satisfied. But it works, and right now that's what I need. If anyone has a better solution PLEASE post it. I've searched the web and found diddly.
Iterate over each character in the given string and use Convert.ToInt32 (c) to get its ("hopefully" unicode) integer value. For all characters over say 127 (as I believe that's where standard ASCII ends),...Leave a comment:
-
Proper (complete) Html encoding
Hello. I need to take a string in UTF-8 with extended characters (e.g trademark, curly quotes, etc) and encode it for html, with either the html named entities or xml numbered (unicode) entities.
I've tried HttpUtility.Htm lEncode(), but from what I can gather, this function is really (at least originally) only intended to prevent cross-site scripting, and therefore only encodes some characters, leaving the others unchanged.
... -
[C#] Is it possible to implicitly wrap each line in a try/catch block?
Hi all. I have a method involving several statements, none of which are dependent on any other. Basically I am simply setting a bunch of properties, one after the other, and want to essentially ignore exceptions on a per-line basis throughout this block. In other words, if an exception occurs, I only want that line to be skipped and execution continue on the next, just as if I had this:
Code:void method() { try { NonCriticalOperation();
-
If the property is being properly set (as you imply by verifying this using breakpoints) then it sounds like a refresh issue. Try explicitly calling TextBox.Refresh ().Leave a comment:
-
Floating windows that don't steal focus
Hi I'm curious if anyone knows how to create a window (such as a tool palette) that remains overtop another window, but doesn't steal the focus (highlighting) of that window when clicked.
I know about the TopMost property, but even with this set, windows still steal the focus. -
-
Leave a comment:
No activity results to display
Show More
Leave a comment: