|
Thanks. Actually, that was not the problem. Basically, I wanted to use a DataGridView to display changes to the underlying data source, while using the data bound text box controls for editing purposes. Unfortunately, the way I set it up, the data table was not getting changed by changing the text box values.
Still, I have encountered another problem, and that is a concurrency violation. What could be the source of the concurrency violation?
|
|
|
|
|
concurreny problem occurs when more than 1 users are trying to update the same record, it might happen that one will end up changing a record that has already been modified by other users.
To fix concurrency violation, in your update query check if the record that you had read (and you're about to modify) has been modified or not. If it has been modified, don't update. Otherwise update it.
This is called optimistic concurrency control.
|
|
|
|
|
Thanks. I am certain that no other user is modifying the record. Could there be a concurrency violation because of some coding error?
|
|
|
|
|
can you please post the query that you're using and also the error message
|
|
|
|
|
Hi,
In my windows application if I'm getting ExternalException when I use the following to methods if the text parameter is too large.
g.MeasureString(text, font, size, format);
g.DrawString(text, font, color, rectangle, format);
I have tried to make the size and rectangle parameters to be large so that it fits the text, but I still get the same exception with Message : "A Genric error occurred"
Please let me know how I can fix this.
Thanks
Ben
|
|
|
|
|
How big is your string ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Length of the string 103325
|
|
|
|
|
Well, that's just silly
That error generally means you've used too much of a resource, or you've tried to use a resource that's not available to you. With that many chars, I am not surprised.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Is there any work around?
|
|
|
|
|
Instead of trying to draw one large string why don't you break it up and draw them individually?
█▒▒▒▒▒██▒█▒██
█▒█████▒▒▒▒▒█
█▒██████▒█▒██
█▒█████▒▒▒▒▒█
█▒▒▒▒▒██▒█▒██
|
|
|
|
|
I can, but I'm more interested in find out if there is a cutoff on the length of the string that gdi+ can handle thru these 2 methods.
|
|
|
|
|
GDI+ works with strings that are either "Pascal strings" (length + data) or "C strings"
(null terminated), so it has a explicit notion of string length (which gets set to -1
for C strings).
And I would not be surprised there are some 16-bit limitations to integer quantities
(hence max 65535 or even 32767 since -1 suggests signed integers are used for lengths).
one thing I found after a quick Google was:
"Due to a limitation of the GDI+ decoder, an System.ArgumentException is thrown if you construct a bitmap from a .png image file with a single dimension greater than 65,535 pixels."
If you really want to know, continue searching, or perform some experiments.
I would suggest trying string lengths of 32700, 32800, 65500 and 65600.
Luc Pattyn
|
|
|
|
|
|
Hi,
I have added a reference for a managed c++ dll to a c# project. I can view the c++ classes and their methods in the object browser. I can also create an instance of the class objects in c#. However, intellisense does not show the object's methods, and if I try to call them, I get an error about them not being defined.
Anyone experienced this in the past? Any suggestions?
Thanks,
-----------------
Genaro
|
|
|
|
|
Are you using the namespace they are in, or scoping it explicitly ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
They are not wrapped in a namespace. Do they have to be?
-----------------
Genaro
|
|
|
|
|
I expect so. There's no global namespace in C#.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi everyone.
I've been asked to research for a way to retrieve information from a remote pc, which only has modem conectivity, without internet access.
I would just like to know if there's any way of doing this with c#. A good hint to start research would be helpfull as well.
Thanks for everyone's time.
daniel sovino
|
|
|
|
|
I know regular way is to open StringBuilder&StringWriter, etc. Which work fine for flat text.
But overall I believe I need to specify one printFont at end of this method and that is all.
What if I want to print document with pictures and lot's of different fonts (multipage...). Is there some better way to do this?
Thanks!!!
|
|
|
|
|
OK I figured out WebBrowser actually have it's own Print method so scratch that one.
RitchText box is still problem though I have found some solution that involve calling some win32 api methods but it's over complicated and it make program overweight too much.
|
|
|
|
|
|
Hi,
I am working on our new company's website. I have created a dynamic JavaScript script that will generate dynamic links that are based on user's client parameters such as screen width, height etc.
In order to debug and test my scripts, I am looking for a way to created automated tests for different client scenarios.
I am currently using c# 2.0. I have created a form with a WebBrowser object that will simulate different client scenarios. What I am trying to load our website and extract the links from the web client component but here is the catch - I need to extract the links from the document and not from the page source. The reason for it is that when you look on the source, you will not find the links since they are being generated by the JavaScript file. I am confident that there is a way to do it since if I will right click on the links in the webclient component and select to copy the link or if I hover the links, I see the correct ones.
Can you advice on what is the best way to get it done? Will the IHTMLDocument2 component be able to extract those links? If not, is there another way to do it?
Thanks,
Joe
|
|
|
|
|
So, you want to extract the hyperlinks from the actual IHTMLDocument2? This MSDN article[^] covers that scenario.
|
|
|
|
|
I found the HTML Agility pack tool [^]to be very useful.What it does is that it parses any HTML files and extract HTML tag (hyperlinks being one of them).
|
|
|
|
|