|
Hi
I'm using TableAdapterManager to update relational data. when i insert a master row then insert some child rows and then press update, the following exception occure on UpdateAll method :
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
i know solution of this problem is handle BindingSource.AddingNew event of child table, if i using BindingSource (see this link: http://msdn.microsoft.com/en-us/library/bb384432.aspx[^]), but i don't use BindingSource and my problem is that how to solve this issue without BindingSource ?
Thanks
|
|
|
|
|
I have a type ahead textbox and on each key press I post back to the server. while the textbox is waiting for the results I would like to display a spinner icon next to the text in the textbox. this spinner icon would indicate that the textbox is waiting for the results.
I have looked at various properties of the text box and couldn’t any property which would allow me to do that.
any suggestions would be appreciated..
thanks,
kar
|
|
|
|
|
I would recommend you look at the AJAX tool kit and use an update panel with an update progress control and respond to the textbox.textchanged event. You may have to set auto postback to true on it as well. This article may help for the AJAX peice.
The UpdateProgress Control of ASP.NET AJAX Extensions[^]
Hope this helps.
|
|
|
|
|
Thanks for the info.. The Text box i wam working on is Winforms textbox. Is there a similar thing that works in a Winforms environment..
Thanks
kar
|
|
|
|
|
Oh I thought you were using ASP.NET since you were sending back to server (what I get for assuming)... You can still respond to the TextBox.TextChanged event. This fires after any input into the textbox. You can use an animated gif to put into an image control to be visible while you are performing whatever operation during the event and set it to visible = false when your processing is complete.
private void currencyTextBox_TextChanged(object sender, EventArgs e)
{
imageProgress.Visible = true;
Application.DoEvents();
...
imageProgress.Visible = false;
Application.DoEvents();
}
You may have an issue with setting the visiblilty in the current thread... the Application.DoEvents() may solve that, but may not, you may need to look at doing the proccessing on a different thread, you could use a backgroundworker for doing that and it is fairly easy to implement.
Hope this helps.
|
|
|
|
|
This one helps.. but the imagecontrol is seperate from the textbox. In my scenario the image control is inside the textbox.
more specifically on the right most side of the textbox where its spinning while waiting for the results to come back..
Could u let me know how I could tie up the image control inside the textbox.
Thanks,
kar
|
|
|
|
|
try using your own user control that contains textbox and image control,
add event begin and end progress to trigger visibility of your image control
hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
You could do something like this. Not perfect or complete but should be a start.
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class BusyTextBox : TextBox
{
private Image busyImage;
private bool isBusy;
public Image BusyImage
{
get { return busyImage; }
set { busyImage = value; }
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
Browsable(false)]
public bool IsBusy
{
get { return isBusy; }
private set
{
isBusy = value;
if (value)
{
using (Graphics g = this.CreateGraphics())
{
}
}
else
{
Invalidate();
}
}
}
protected override void OnTextChanged(EventArgs e)
{
IsBusy = true;
base.OnTextChanged(e);
IsBusy = false;
}
} Make sure you dispose of the busyImage if not null when the BusyTextBox is disposed!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
You mean something like the ErrorControl? You might be able to wrangle that functionality to do what you want.
Codemonkeys don't do it at all. Too busy coding.
|
|
|
|
|
|
wth cd
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
code it, build it, ship it!
|
|
|
|
|
Errrhmmmm ... I don't think I see Testing in there!
10110011001111101010101000001000001101001010001010100000100000101000001000111100010110001011001011
|
|
|
|
|
can't test without specs...
|
|
|
|
|
Luc Pattyn wrote: can't test without specs...
I wish every company I have worked for had believed that...
|
|
|
|
|
OriginalGriff wrote: I wish every any company I have worked for had believed that...
Fixed that for you
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
They just believe you don't need to test so long as you coded it perfectly the first time. There's always plenty of your personal time later to fix any bugs the customer finds.
Codemonkeys don't do it at all. Too busy coding.
|
|
|
|
|
Pfft... like that matters.
|
|
|
|
|
|
Get yourself some magnets and a very powerful magnifying lens
|
|
|
|
|
Step One: Step away from the computer
Step Two: See Step One
|
|
|
|
|
Well, you will need a few things.
1) A Computer, with a monitor, keyboard, mouse and all the normal bits. (You can get one from eBay)
2) A Compiler / linker / doobry. (You can get one from those kind people at microsoft)
3) A good Idea for a program. (You can get one from your mates)
4) A very large collection of Ones and Zeros. (You can get them from me - I have a large stock of spares, some new, some used). Very cheap prices in bulk.
Now, organise the Ones and Zeros so that they fullfill your Idea.
Pass the Idea through the Compiler / linker / doobry so that the Computer can understand them.
Run the compiled Idea on the Computer.
Simple, isn't it?
Now you just have to wonder why we all go to school, then university, and slave for a number of years in the industry before we call ourselves Software Engineers.
|
|
|
|
|
OriginalGriff wrote: doobry
Do you have any links to where I can get one of these - I think that may be where I've been going wrong!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
No thanks, I mix up my 0 to 9s with some A to Fs and my special binary mixer does the rest for me.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|