|
|
No. You delete your cousin.
|
|
|
|
|
|
Halapinos on his toothbrush.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
mmmm... halapinos... yummmyyyyyyyyy
foreach( inch on Jason )
{
Girlfriend.IsHappier();
}
|
|
|
|
|
Hi,
How to get all the selected values from a listbox in windows application?
Thankyou
YPKI
|
|
|
|
|
Hi,
set ListBox.SelectionMode to one of the Multi modes, then use either ListBox.SelectedIndices or ListBox.SelectedItems
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
i have a dataGridView and bindingSource in my form and i fill my gridView with this two lines of code :
DataManager dm = new DataManager();
this.frmDataSet.Ground.Merge(dm.GetGrount(Guid.Empty.ToString()));
it display data in dataGridView correctly. now i want to load data with backgroundWorker. for this i modify above code as follow :
this._frmLoading = new FrmWait("Please wait", "Loading data ...");
this.backgroundWorker1.RunWorkerAsync();
here is my backgroundWorker event handlers :
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
DataManager dm = new DataManager();
this.frmDataSet.Ground.Merge(dm.GetGrount(Guid.Empty.ToString()));
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (this._frmLoading.IsShowing)
this._frmLoading.Close();
}
at runTime, all code works correctly but data does not display in dataGridView, when i trace my app my dataSet has rows but i don't know why dataGridview could not display this data with BackgroundWorker.
can anybody help me ?
thanks
|
|
|
|
|
Is the DataView bound to the dataset? In that case, updates on the data set will cause the dataview to update as well, and those updates will occur on the background worker thread, instead of the UI thread.
Did you try unbinding the dataview, merging it in the background, and then binding it again?
|
|
|
|
|
Hi Senthil
my dataGridvIew bound to bindingSource in designer code, however i set dataGridView.DataSource property to bindingSource but it still did not display data.
|
|
|
|
|
Hi, I developed an Client / Server application, the problem is the following:
- when a wrong IP address is inserted in the Textbox, Client application freeze.
TcpClient socketForServer;
try
{
socketForServer = new TcpClient(Ip, Port);
}
catch (Exception e1) {
info._error = e1.ToString();
return info;
}
What I can do?
|
|
|
|
|
You will want to start running your TCPClient on a different Thread so it doesn't lock up the GUI thread while waiting for a timeout or connection refused.
So do the following
ThreadPool.QueueUserWorkItem(new WaitCallback(<function that="" starts="" the="" tcpclient="" connection="">));
Keep in mind that the Drawing of items can only be done on the thread they were created on (usually the main thread) so setting text and that sort of thing should be done by invoking the functions using the Invoke function
|
|
|
|
|
Alternatively you can also use the asynchronous methods of TCP client to make your connection, BeginConnect and EndConnect
|
|
|
|
|
|
there are couple of things that you may do
1. Application.DoEvents()
2. You need to set socketForServer to null in case an error occurs, it will be creating a new object every time and will become a source of memory leak.
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
I have loaded 6 columns to a DataSet using a DataAdapter. Now I want to change the first column's items to a frequent series of numbers.I have tried the code below ,but it didn't affect the data:
for(int i=0 ; i
|
|
|
|
|
saeidfarahi wrote: myDataSet.Tables[0].Rows[i].itemArray[0] = i + 1;
DataSet.Table is read-only, therefore cannot be edited.
Have you thought about putting the DataAdapter into a DataTable instead, then edit the DataTable, then adding it to a DataSet if necessary.
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
You need to get a datatable from database and do something like this.
DataTable dataTable = new DataTable ( dataTableObject.TableName );
DataColumn dataColumn = new DataColumn ( columnName, Type.GetType ( "System.Int32" ) );
dataColumn.AutoIncrement = true;
dataColumn.AutoIncrementSeed = dataColumn.AutoIncrementStep = 1;
dataTable.Columns.Add ( dataColumn );
DataTableReader dataTableReader = new DataTableReader ( dataTableObject );
dataTable.Load ( dataTableReader );
DataSet dataSet = new DataSet ();
dataSet.Tables.Add ( dataTable );
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
hello,
i am using the following code:
WebBrowser Web = new WebBrowser();
Web.Navigate("http://...", "_blank");
.
does anyone know if it is memory consuming?
and if i dont have internet explorer as a default browser will it work?
for example with firefox.
tnx ,
avi
|
|
|
|
|
shabya wrote: does anyone know if it is memory consuming?
Yes, very. It says so in the documentation[^], 'The WebBrowser control is resource-intensive. Be sure to call the Dispose() method when you are finished using the control to ensure that all resources are released in a timely fashion. You must call the Dispose() method on the same thread that attached the events, which should always be the message or user-interface (UI) thread.'
shabya wrote: if i dont have internet explorer as a default browser will it work?
Yes
My failometer is detecting vast quantities of FAIL!
"Its SQL - hardly programming..." (Caslen)
|
|
|
|
|
though it is memory consuming but you can use it normal circumstances easily. If you have a very resource hungry application then you should avoid using it. You can use it irrelevant of what your default browser is.
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
shabya wrote: and if i dont have internet explorer as a default browser will it work?
for example with firefox.
It still uses Internet Explorer to render the page, regardless of your default browser.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
about the browser being opened -
what if explorer is removed ? (if it is possible i dont know)
i went to the WebBrowser thing because i couldn't open the desired URL in a new window. what happened was it ran over an existing page...
the code that i used:
System.Diagnostics.Process.Start("http://www...");
.
using iexplore /new and stuff doesnt work here
tnx
|
|
|
|
|
You might be able to remove the Internet Explorer application, but the rendering engine that the control uses is still there.
If the browser opens a new window or reuses windows is a choise in the browser settings. In Internet Explorer it's under advanced options and is called "Reuse windows for launching shortcuts".
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
tnx , but i cant ask my customers to do that , they are usually art and nature like activists...
|
|
|
|