|
I need to read all the items. So using loop is not good idea thats why i'm looking to convert entire ListView into DataSet. Can any one help out.
|
|
|
|
|
I understand you need to read all items but do you need to do this everytime the application is run or can you do it just once "by hand". E.g. does the data change everytime you run the program so that you need to update the dataset everytime you run the program. If this is the case then the only way I can think of is if you do it in a loop, iterating through all the ListViewItems.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
Hello!
I have programmed an MS Office add-in that lets the user push a button, enter some information in a custom dialog and then print the e-mail. My problem is that I want to give the user the possibility to select whether he/she prints the e-mail with or without attachments.
Any idea how to do this so that the user doesn't have to change the setting manually in the print dialog beforehand? It should work in Outlook 2000 and Outlook 2003 at least.
TIA, Mario
-- modified at 3:57 Thursday 20th July, 2006
|
|
|
|
|
Hi,
I'm using Microsoft's DAAB, and I am just a bit confused as to what variables I must "dereference".
I have the following peace of code (not all code is shown):
Database db = DBHelper.GetDefaultDatabase;
using (dbCommand = db.GetStoredProcCommand("sp_OrderTypes_GetAllOrderTypes"))
{
using (rdr = db.ExecuteReader(dbCommand))
{
while (rdr.Read())
{
....
}
}
}
The rdr and dbCommand variables are taken care of by the using block, but what about the db variable? Is it ok as it is? Don't I have to close or "dereference" it anywhere?
Please can someone help with my confusion.
Thanks
ma se
|
|
|
|
|
If the Database type provides a Close or Dispose method or something similar you should definitely call it.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
hi,
Just wanted to ask how to make the windows service interactive in .net 2.0, can any body help... I have changed the registry value to type to 272(dec) in LocalMachine\SYSTEM\CurrentControlSet\Services\SERVICENAME registry key... but still its not working... can any body help please...
Thanks,
Regards,
Waqas
|
|
|
|
|
Microsoft now advise against interactive services. They can be susceptible to 'shatter' attacks, where a non-privileged process can cause the service to execute some privileged action by sending it window messages. By definition an interactive service has to run as the SYSTEM account which is very highly privileged - you should endeavour to configure your service to run with the lowest privileges possible.
In Windows Vista and "Longhorn" Server, an interactive user session will be session 1, while the interactive services will run in session 0 as they do now. As a result, the user will not see any UI that the interactive service displays - 'interactive' services will only be able to interact with each other. I have an interactive service written in VB6 which suffers from exactly this problem.
If you need UI, you'll need to come up with a way for a separate UI process to communicate with your service.
Stability. What an interesting concept. -- Chris Maunder
-- modified at 6:05 Thursday 20th July, 2006
|
|
|
|
|
how can i use this.controls in c#. i need to control the label
for example..
for(int i=1; i<4; i++)
{
label(i).text = "";
}
how can i control the labels in this situation... i don't know how to use this.controls in this situation or are there other ways.
|
|
|
|
|
foreach(Control c in Controls)
{
Label l = c as Label;
if (l != null) l.Text = "";
}
Remember, C# is case sensitive.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Would you also use this?
foreach(Control c in this.Controls)
{
if(c is Label)
c as Label.Text = "";
}
All the best,
Martin
|
|
|
|
|
Using 'is' followed by 'as' causes two runtime type lookups to occur, one to do the boolean test, the other to actually perform the cast. Using 'as' alone followed by a test for null performs better.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Martin# wrote: c as Label.Text = "";
Apart from being a mess because it requires two lookups ( as someone else said ), I don't think this will work as you've typed it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sure,
foreach(Control c in this.Controls)
{
if(c is System.Windows.Forms.Label)
{
System.Windows.Forms.Label l = c as System.Windows.Forms.Label;
l.Text ="";
}
}
-- modified at 7:15 Thursday 20th July, 2006
|
|
|
|
|
|
Of course,
I really understud what everybody else explaint me before.
but thanks for youre interest,
All the best,
Martin
|
|
|
|
|
Thanks for your statements,
All the best,
Martin
|
|
|
|
|
Is there no way, that
c as Label
causes an exception?
Thanks for youre time.
Martin
-- modified at 7:42 Thursday 20th July, 2006
|
|
|
|
|
No, c as Label will return null if c is not a Label.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you,
I will go threw my code for cleaning up a little, I think.
All the best,
Martin
|
|
|
|
|
hello !
how to know that
what application/program is consuming what/how much resources of the system.
if some source code is there, plz send it
|
|
|
|
|
Please check this in MSDN System.Diagnostics.Process!
Process class in System.Diadnostics namespace includes all the things related to the work you are going to do. I hope you'll find your solution yourself.
Best Regards,
Rizwan Ahmed
|
|
|
|
|
G'day guys,
Today I have been playing with the option of having to insert additional user interface dialogs in the setup msi project in visual studio. One my goals in this setup msi project is to allow the user to select the option of whether they want to read the user guide or install the software. I have implemented this option as a two radiobutton form under the User Interface Option.
The problem I am experiencing is that, when the user selects the option of simply viewing the user guide, the setup msi starts to install the software once the software is half through the installation it then fires up the user guide then continues to complete the installation.
What do I need to do in order to prevent the setup msi from installing the software when the user selects the option of viewing the user guide document.
I have used the following article as a reference to get me started in customizing the user interface dialog:
http://www.codeproject.com/dotnet/Easy_Custom_Setup.asp
Any pointers will be most appreciated.
thanks
|
|
|
|
|
hi ,
I used a listbox for going to the next or previous record .For the savebutton event , I wrote this :
private void btnSave_Click(object sender, EventArgs e)<br />
{<br />
...<br />
PopulateListBox1();<br />
}
and For the PopulateListBox1() Function :
private void PopulateListBox1()<br />
{<br />
...<br />
if (ListBox1.Items.Count > 0)<br />
{<br />
ListBox1.SetSelected(ListBox1.Items.Count - 1, true);<br />
}<br />
...<br />
}<br />
thus , the last record is selected .If I want to select the current record when I press the savebutton , How can I do it ?
thanx
s_mostafa_h
-- modified at 2:17 Thursday 20th July, 2006
|
|
|
|
|
You can find the value or text in the list first and then made that selected.
Best Regards,
Apurva Kaushal
|
|
|
|
|
can u more explain ?
thanx a lot ,
s_mostafa_h
|
|
|
|