|
I wouldn't be too concerned about the overhead of creating a table each time, this would be far more effecient than multiple calls to an update proc. AFAIK, there isn't really a way to bulk update a database, but you can bulk insert into it very quickly.
So, if you did want to try this approach, create a new prepare proc which creates the table, use the SqlBulkCopy class to rapidly write to this, and then call a commit proc which updates and inserts based on this table and deletes it afterwards.
Regards,
Rob Philpott.
|
|
|
|
|
Yes maybe you are right.
I have tried I think everything else.
So I'll try this solution.
Thank you very much for your help Rob
|
|
|
|
|
I use a parameterized statement with ExecuteNonQuery, usually with a transaction.
|
|
|
|
|
Hi,
I have listbox and im retriving text in listbox by selection.
When i selected item, the SeletionChanged function get invoked twice.
private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
string str = (String)listBox1.SelectedItem;
listBox1.SelectedIndex =-1;
}
When i set breakpoint in bolded line first time it shows "",then when i press F5 it again comes to that place and shows the correct Text.
I want to get the text in first execution itself.
Anu
|
|
|
|
|
Several Controls fire their XxxChanged event more than once; AFAIK the exact behavior isn't documented, so you can't rely on it, nor rightfully expect a particular behavior. You can think of it as: in a first step the current selection gets unselected, then the new selection becomes in effect.
You will have to cope with such behavior; having the first event with an empty selection should make that not too hard.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
hi,
listBox1.SelectedIndex =-1 will raise the SelectionChanged event too, because the current selection changed to -1.
check on the selectionchangedeventargs if the new index is -1 to return before doing the stuff you want to.
greetz
|
|
|
|
|
Yes you are correct.
When i comment that listBox1.SelectedIndex =-1 line,when i work its works fine.
But i want to deselect the selected item after i seleted that.
How can i do that?
Because after selecting,the selected item is in blue color.I dont want tht.
Anu
|
|
|
|
|
Hi everyone,
Does anyone knows how to get shared folder sharing permission for certain user name or group? For example, for username "Everyone", how do get the info whether the sharing permission is Full Control, Change or Read?
Thanks in advance
|
|
|
|
|
There are classse called DirectorySecurity and DirectoryInfo . Although I haven't done this but I think one of them should provide this information.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi ALL,
I have a list of point coordinates (x,y) to draw a line. The line is curve. I need to draw 2 parallel line, at left and at right of this line. My scope is to draw a rounded line of intere line.
Help me please, with example.
Thanks.
Alex
|
|
|
|
|
Could you please make it clear what do you want to do?
AlexB47 wrote: My scope is to draw a rounded line
Rounded line? Did you mean a Curve??
|
|
|
|
|
|
AlexB47 wrote: The line is curve
Is it a curve or a straight line?
AlexB47 wrote: My scope is to draw a rounded line of intere line
You mean circle?
Graphics class has methods like DrawLine , DrawCurve and DrawEllipse . Read about them and you should be able to do this.
Make sure you do your drawing in the Paint event and use PaintEventArgs.Graphics object to draw.
Drawing the parallel lines should be simple: get the X coordinate of the "end" from where you need to draw the parallel line. Then with same X coordinate, just change the Y and draw the line. Choice of Y coordinate would depend on the length of the parallel line segment you need to draw.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
curved line.
I have to build 2 parallel lines of a GPS track (so curved path). Building a sort of lane of the road.
Alex
|
|
|
|
|
That's tricky. You can only draw lines on the left and the right when the road runs north to south. With east to west, you'd need to draw them top and bottom.
I think you're going to be need some trigonometry to do this. You could probably cheat by drawing a thick line and overlaying a thin line and let windows do the rounding of intersections.
Are you in GDI or WPF?
Regards,
Rob Philpott.
|
|
|
|
|
in GDI (I use DrawLine etc...).
Alex
|
|
|
|
|
Ok, using the 'hack' mentioned above, create a new windows forms application in visual studio, and add the following in form1.cs
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
GraphicsPath p = new GraphicsPath(FillMode.Alternate);
p.AddLine(0, 0, 50, 50);
p.AddLine(50, 50, 60, 50);
p.AddLine(60, 50, 60, 60);
p.AddLine(60, 60, 90, 130);
Pen pen = new Pen(Brushes.Black, 10);
Pen p2 = new Pen(Brushes.White, 4);
e.Graphics.DrawPath(pen, p);
e.Graphics.DrawPath(p2, p);
}
That's one approach...
Regards,
Rob Philpott.
|
|
|
|
|
yep. that is what I would try, intuitively I would use odd line widths though.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Rob Philpott wrote: That's one approach...
Which is nice, apart from the fact that you are not .Dispose() the GraphicsPath and Pen instances you created.
All the best,
Martin
|
|
|
|
|
Thanks.. I try with your solutions ...
Alex
|
|
|
|
|
Hello,
I have another problem. Is there a way to avoid that the circuit is redrawn below? I to draw the current point that moves, use the DrawEllipse function (current position). How can I avoid soiling the circuit with all subsequent drawEllipse?
Thanks.
Alex
|
|
|
|
|
|
Haven't you posted this at least two times before...? This is not the forum for these kind of posts..
|
|
|
|
|
How many times are you going to do this? You already have annoyed a lot of people. I would say stop it before someone reports you and you get banned.
People have already done that. Now what are you pleading for? If you think this way your article would get published, then let me tell you : No it will not be.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Not again.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|