|
how can we save exist information in a database table using datagridview with foreach rule?
foreach (DataGridViewRow ro in (dataGridView1.Rows))
{
???????
}
|
|
|
|
|
Why do you want to use the for each loop to do this?
Look for the existing implementations .Net provide to update the database. For eg. dataset.update
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Pliz help me to call another form to display a video command from a different form
|
|
|
|
|
Up at the top of this list of questions is a selection "How to get an answer to your question".
Read it, and try again.
This may explain why you (currently) have 7 votes for "Bad Question", and none for "Good question". It may also explain why you have no replies (other than this, if you are going to be picky)...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Dear members am glad to be a member of this blog.
I would like to pass on my special thanks to all who have helped me to learn how to program in C# .
It is because of you that I learnt how to Design a music player.
Now pliz help me to skin my player. Email:nabende.george@yahooo.com
Those interested in Friendship are highly welcomed.
Am george based in Uganda.
|
|
|
|
|
Firstly, I congratulate you on learning a programming language by teaching yourself, if you have made good strides then that's great.
Secondly, if you posted here, you should be familiar with the rules by now. Start doing something, if you get stuck then post exactly where, don't e vague asking for general help like 'skinning your player'. Don't post your email either, it's an invitation to get spam.
Read the rules again.
Good luck.
|
|
|
|
|
Hi,
How can a suspended thread can abort.
Thankyou
YPKI
|
|
|
|
|
Hi,
According to the documentation and the compiler warnings you must be getting Thread.Suspend is obsolete since .NET 2.0; you should not use it any longer.
FWIW: To abort, you should undo the suspension, hence try Thread.Resume first.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
You could undo it after. See my reply.
|
|
|
|
|
try
{
yourThread.Abort();
}
catch (ThreadStateException e)
{
yourThread.Resume();
}
|
|
|
|
|
for (number=0;primes<10001;number++)
That is a valid for loop.
However, I am trying to parallelize this, and Parallel.For will only accept one delegate.
Therefore, if I wanted
for (number=0;number<10001;number++)
I could do
Parallel.For(0,10001, delegate(int number))
Parallel.For has no overload which accepts two delegates.
What is the Parallel.For equivalent of the first snippet?
Thanks,
Fahad Sadah
|
|
|
|
|
Fahad Sadah wrote: for (number=0;primes<10001;number++)
If primes doesn't change in the body of the loop, why doesn't
Fahad Sadah wrote: Parallel.For(0,10001, delegate(int number))
work?
|
|
|
|
|
It probably does though. Why else would he have asked?
|
|
|
|
|
Well, if it does, the code isn't really parallelizable. If each iteration of the for loop overwrites the variable in a way that is dependent on previous iterations, it doesn't really make sense to parellilize it. For example, if it really is calculation of primes, then numbers = 10000 could run before numbers = 2.
|
|
|
|
|
|
Good question!
The problem you have is that you don't know the bounds of your input - you don't know how big number will have to get to generate the required number of primes .
However, you can still parellelise chunks of work - something like this:
const int N = ( int ) 1e6;
static readonly int STEP = Environment.ProcessorCount * ( int ) 1e6;
...
var primes = new List<int>( N );
for ( int start = 2 ; primes.Count < N ; start += STEP )
primes.AddRange(
Enumerable.Range( start, STEP )
.AsParallel().AsOrdered()
.Where( i => IsPrime( i ) ) );
primes = primes.Take( N ).ToList();
You'll have to tune the values of N and STEP for your specific case.
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Hi,
In an application playing number of files from a folder, i need to use slide bar.
How can i implement in my application. I am using 2005 framework.
Thankyou,
YPKI
|
|
|
|
|
What do you want the slidebar to look like, and even more important, what do you want the slide bar to represent?
|
|
|
|
|
Hi,
I am working on a small application that checks what browsers are installed on a system running Windows Xp... I was able to find the right entries to check whether Firefox and Chrome are installed or not... And after quite some amount of googling about IE, I found that IE might get corrupted due to some unforeseen reasons... So, is there a possibility of a windows system to have NO internet explorer installed? If yes, How can I check whether IE is present or not.. Please suggest...
Thanks in Advance
|
|
|
|
|
IE is a part of Windows itself and you can safely assume its existence on Windows. I personally won't go bothering about an usecase where the IE installation is corrupt for some unforeseen reasons. It may be negligible.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Is there any way to get a XmlTextWriter to work with a MemoryStream, so that it doesn't close it when it is finished?
What I'm trying to do is:
List<T> -> MemoryStream (as XML) -> TripleDES encyrption -> file.
And later:
file -> TripleDES decryption -> MemoryStream -> List<T>
And since XmlTextWriter always closes the stream when it completes, the MemoryStream is useless!
Yes, XMLTextWriter has settings, but they are null or read-only, so you can't set "CloseOutput = false"
(No, I don't want to use XMLSerialiser, for very dull reasons!)
I have got round it by moving to XmlWriter and using the settings that way, but this was such a waste of time!
Old way:
WriteXML(listCards, new XmlTextWriter(stream, Encoding.UTF8));
if (stream.CanSeek)
{
stream.Seek(0, 0);
}
New way:
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = false;
settings.ConformanceLevel = ConformanceLevel.Document;
settings.CloseOutput = false;
settings.Indent = true;
settings.Encoding = Encoding.UTF8;
WriteXML(listCards, XmlWriter.Create(stream, settings));
if (stream.CanSeek)
{
stream.Seek(0, 0);
}
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
Does anyone know a way I could simulate 7.1 channel surround sound with DirectX? Our school is doing the Wizard of Oz as the school play this year, and as part of it, we want the tornado to move around the Audience, we have speakers in the right spots, and the everything we need to drive them, its just we need to be able to move the sounds around and make them feel realistic to the audience.
So in short, does anyone know how I could set up 7 listening devices in DirectSound or XNA so that the levels change for each speaker as the virtual speaker moves throughout the audience.
And here's a crude drawing of the idea: http://img30.imageshack.us/img30/3246/tornadopath.jpg[^] (each speaker group represents a different channel)
|
|
|
|
|
DirectSound does support 7.1 - set the speaker config to DSSPEAKER_7POINT1_SURROUND. (Or to DSSPEAKER_7POINT1 if you haven't gone up to XP SP2 yet.)
Then it should be just a matter of moving the sound source around the listener location, and Dorothy's your auntie...
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Hello,
How can i open aspx webpage using c# window application?
I mean not using "System.Diagnostics.Process.Start"
but another way so i can check if there is such webpage (try...catch.. or something)
|
|
|
|
|
//in windows application there is no such thing as aspx page.
//in web application we can open a aspx page as,
Response.Redirect("Sample.aspx");
(or)
server.trasfer("Sample.aspx");
//you can open a form using windows appliaction like,
Form2 frm = new Form2();
frm.Show();
Padmanabhan
|
|
|
|