|
Well you need to be at least accurate in your descriptions, I'm betting you are using a DataGridView rather than a GridView.
Without some accurate, relevant and detailed information about your specific problem we cannot help you, your question is too vague.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how can I signal to special thread that blocked behind a monitor.
in fact I want to specify a priority number for each thread and threads run in sequence.
please help me
shahin gholami
|
|
|
|
|
shahin gholami wrote: how can I signal to special thread that blocked behind a monitor
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I'm control threads by a monitor and I want to assign a priority number to each thread
for example:
thread1 with priority number:2
thread2 with priority number:1
thread3 with priority number:4
thread4 with priority number:3
I want to execute my threads in this sequence:
thread2
thread1
thread4
thread3
shahin gholami
|
|
|
|
|
Hi All,
In Windows while loading the form,it flactuates very much.Please give any solution for it...
Regards,
Lalit Narayan
|
|
|
|
|
Be generous, give us some detail of what the problem is, it flactuates very much is a little vague.
Have you stepped through your form activation code to see what possible causes there are.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello experts...
I used crystal controle in vb.net and i dont know same in c#....Please tell me how can i use it in C#? I am using it for binding parameterfield to descrete value of crystal report.
|
|
|
|
|
Hi Experts...
Please anybody suggest me any link of source code for login in C#.In Code project i got same in asp.net and vb.net.
|
|
|
|
|
login code means to validate username and passowrd and allow to redirect to next page... am i correct....
Padmanabhan
|
|
|
|
|
Ya...same thing i have to do.....u r correct...but in my login my MDI form will be disabled and focus is on login form.My MDI will be behind the login form but in disable mode.
|
|
|
|
|
Where are you storing your username and password? You storing it in your application or in a Database? These details would help.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
i m using SQL2005 database for storing values of username n pwd.fron end :C#
|
|
|
|
|
See the search option on the top right of the page, that will help identify if this question has been answered before, try it you'll like it. Looks like plenty of feedback on this subject for you to look into clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have an email application and when checking mails I use a new thread (so it doesnt stuck the whole program while downloading data).
the problem is that this method (runned by the new thread) fires some events, and some of that events have observer methods that modify a textbox (txtLog).. and it throws this exception InvalidOperationException..
How do i resolve this?
The weird thing is that some observer methods modify a status bar and there the exception isnt thrown
|
|
|
|
|
Hi,
you need to invoke a delegate, have a look at the SetText method of this article[^] (SerialPort.DataReceived event also runs on a separate thread).
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.
|
|
|
|
|
Thanks,
why does cross threading work with a label on a status and not on a textbox?
|
|
|
|
|
Hi,
I don't know, I am not convinced your observation is correct: Controls are NOT thread-safe and since they typically are all interconnected in some way, you should not touch any Control from a thread other than the main thrad (aka GUI thread). Sine .NET 2.0, when you do, an InvalidOperationException is to be expected.
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.
|
|
|
|
|
May I use a lock(new Object()) for making it thread-safe instead of the InvokeRequired thing?
|
|
|
|
|
No. There is only one correct way to deal with threads and Controls.
Locks and Controls don't work well together, the GUI needs to be un(b)locked at all times.
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.
|
|
|
|
|
Hi
In case of thread cross exceptions you can also use a BackgroundWorker component to run the other thread.BackgroundWorker raise some events and you can handle them.These events will be run in the main thread so no cross thread exception will be thrown if you try to set properties of some controls.
|
|
|
|
|
beatles1692 wrote: raise some events and you can handle them.These events will be run in the main thread
That comment seems a little misleading to me...
If you raise your own event from a BackgroundWorker thread, which would be from a
DoWork event handler, event handlers for your event will not be executed on the UI thread -
they will run on the background thread.
You would have to invoke those events on the UI thread just like you would
from any other thread.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You are right.
I meant:
"BackgroundWorker raises some events and you can handle them"
|
|
|
|
|
Sorry to revive this thread but I have a question:
If I have my model separated from the UI, lets say they are two projects,
If the model is the one running the different threads instead of the UI.. (and the model raises events) then I wouldnt have this problem of crossing threads and the Invoke solution?
Or I would have it either way?
|
|
|
|
|
I have coded to retrieve data from SQL Server to ListView on C Sharp.
Unfortunately, ID field goes wrong. Obviously, it has four records then it display on a listview with double recode. See my codes ....
dbConnection.sqlCnn.Open();
string sSQL = "SELECT * FROM TBL_USER";
SqlCommand sCommand = new SqlCommand(sSQL, dbConnection.sqlCnn);
SqlDataReader sReader = sCommand.ExecuteReader();
while (sReader.Read() == true)
{
_ID.Add(sReader[0].ToString());
for (int i = 0; i < _ID.Count; i++)
//for (int i = 0; i < sReader.FieldCount; i++ )
{
lstItems = new ListViewItem((i + 1).ToString());
lstItems.SubItems.Add(sReader[1].ToString());
lstItems.SubItems.Add(sReader[2].ToString());
lstItems.SubItems.Add(sReader[3].ToString());
lstItems.SubItems.Add(sReader[4].ToString());
lstItems.SubItems.Add(sReader[5].ToString());
this.lsv_user.Items.Add(lstItems);
}
}
sReader.Close();
dbConnection.sqlCnn.Close();
Thanks
Chuon Visoth
Angkor Wat - Cambodia
asp.net - c sharp beginner
|
|
|
|
|
Hi,
your code does not make sense to me.
the while loop iterates over the records, that is OK.
the for loop should not be there: IMO each record only provides data for one item in the ListView.
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.
|
|
|
|