|
Creating a seperate project is not necessary, and the override code is not crazy. Very simple and straight forward.
Almost 5 minutes of work.
|
|
|
|
|
I'm trying to write a little app in C# that'll get some basic system information at startup and then send it to SSE on a different box.
What I'd like to get is username, hostname, list of all user accounts and their groups on the machine, cpu type, machine serial number, mac address, total system memory, and a listing of installed applications.
I can get a few of those things from System.Environment, but I am having a hard time figuring out the rest of it, particularly system memory. I think I might need to use System.Management, but I am not sure how to do that.
|
|
|
|
|
|
how do I turn my Visual studios project in to a stand alone application?
|
|
|
|
|
What??
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
I need to run the code that I wrote in a Visual Studios project outside of the visual studios enviroment. Actually, I need to run it on a computer that does not have visual studios installed.
|
|
|
|
|
You compile your source code to an executable and typically create an installer package along with it. This is done in Visual Studio.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Could you point me to a good example of how to create an installer package?
|
|
|
|
|
Add a "Setup Project" to your solution as you would add any other project to your solution. And then go from there.
To find out more about deploying your application you should read MSDN as it gives you all the information. You'll find the information in the section titled Deploying Applications and Components[^]
You might want to pay particular attention to Walkthrough: Deploying a Windows Application[^] which gives you a step by step guide to creating an installation setup for your solution.
Does this help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
|
I have a mdi child form that has two combo boxes and a data grid. The combo boxes are used to filter the records in the data grid.
The problem I am having is that I load the combo boxes from a dataset in the form load event. I also fill the datagrid from a dataset after loading the combo boxes. It looks to me that the combo box events (selectedvaluechanged) are running before everthing is loaded properly and causes loading errors. Both my combo boxes call a function to reload the datagrid. Am I loading the combo box values in the wrong event?
I hope that made sense.
Thanks,
JefferyS
|
|
|
|
|
Maybe in the selectedindex_changed event handler of the comboboxes , try this:
{
if( this.combo_Box1.SelectedIndex > 0)
{
}
}
Also, let me know if it actually works ( cross your fingers! )
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
Are you setting the selected index for comboboxes? That will cause the event to fire. Try setting the selected index after the datagrid is populated.
|
|
|
|
|
A quick solution would be to use a state variable. Set it to true once you have loaded your data and check it within your SelectedValueChanged before you do anything else within it.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks for all the suggestions. It seams that when you load the combo box (atleast with a dataset) it fires off the selectedItem and selectedvalue events, and maybe other combo box events.
The selectedIndex stayed at 0 all the time so the if(combobox.selectedindex > 0) did work, but sense I was using index 0 for "All" to not filter that category it wasn't going to work for me.
So after many cans of A&W Root Beer, I moved the lines that sets the events for both combo boxs under the last item in the form load event which was the loading of the datagrid. It seams to be working perfectly.
Thanks again for all the suggestions,
JefferyS
|
|
|
|
|
Hi, i'm working on improving the effeciency on a certain block of code and was wondering if any tools existed to see if i'm making positive contributions to the code.
|
|
|
|
|
There is ANTs.
/\ |_ E X E GG
|
|
|
|
|
Do you know Rational Quantify (part of Rational XDE)?
|
|
|
|
|
You will have to analyse your algorhitm then. No point in attempting to make code faster with trial and error. Have a plan.
top secret xacc-ide 0.0.1
|
|
|
|
|
I am programatically building a dataset that populates a datagrid. I need to then specfify the column widths for each column. However, the grid control ignores my input. I first tried setting the widths under TableStyles/GridColumnStyles. That was ignored so I figured it was because I wasn't populating the grid from a predefined datasource. So then I tried progammatically. Still nothing. Below is my code. The grid should only have one table in it. The grid populates correctly, it just doesn't format the widths of the columns. The dataset only returns 3 columns.
//get the data
dsResults = SqlHelper.ExecuteDataset(Conn,CommandType.StoredProcedure,"usp_GetSearchResultsSel",new SqlParameter("@Description", txtDescription.Text),new SqlParameter("@SearchParameters", cboSearchParam.SelectedText));
//populate the grid
dgResults.DataSource = dsResults.Tables[0].DefaultView;
//settings for grid
dgResults.TableStyles[0].GridColumnStyles[0].Width=200;
dgResults.TableStyles[0].GridColumnStyles[1].Width=50;
dgResults.TableStyles[0].GridColumnStyles[2].Width=100;
dgResults.ReadOnly=true;
|
|
|
|
|
I am assuming that its a winform application:
Peter8675309 wrote:
//get the data
dsResults = SqlHelper.ExecuteDataset(Conn,CommandType.StoredProcedure,"usp_GetSearchResultsSel",new SqlParameter("@Description", txtDescription.Text),new SqlParameter("@SearchParameters", cboSearchParam.SelectedText));
dgResults.TableStyles.Clear();
DataTableStyle tabStyle1=new DataTableStyle();
tabStyle1.MappingName = <mapping name="">
//populate the grid
dgResults.DataSource = dsResults.Tables[0].DefaultView;
dgResults.TableStyles.Add(tabStyle1);
//settings for grid
dgResults.TableStyles[0].GridColumnStyles[0].Width=200;
dgResults.TableStyles[0].GridColumnStyles[1].Width=50;
dgResults.TableStyles[0].GridColumnStyles[2].Width=100;
dgResults.ReadOnly=true;
try this :
dsResults = SqlHelper.ExecuteDataset(Conn,CommandType.StoredProcedure,"usp_GetSearchResultsSel",new SqlParameter("@Description", txtDescription.Text),new SqlParameter("@SearchParameters", cboSearchParam.SelectedText));
dgResults.DataSource = dsResults.Tables[0]; <<-- maybe!!!
dgResults.TableStyles[0].GridColumnStyles[0].Width=200;
dgResults.TableStyles[0].GridColumnStyles[1].Width=50;
dgResults.TableStyles[0].GridColumnStyles[2].Width=100;
dgResults.ReadOnly=true;
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
Yes this is a windows form. If I add in
dgResults.TableStyles[0].GridColumnStyles.Clear();
I get an 'index out of range' error unless I prepopulate the TableStyles of the grid prior. I took a look at the code at section 5.3.2 from
http://www.codeproject.com/csharp/PracticalGuideDataGrids4.asp#_Toc56951053.
This functions (if I set the dt equal to me dataset.Column), but it still doesn't modify the column widths.
Thanks for your quick reply.
|
|
|
|
|
Peter8675309 wrote:
dgResults.TableStyles[0].GridColumnStyles.Clear();
clear the table styles, not the gridcolumnstyles.
Well it seems to work for me:
this.dataGrid1.DataSource=null;
this.dataGrid1.TableStyles.Clear();
DataTableStyles tab1=new DataTableStyles();
tab1.MappingName="ShoppingTables";
this.dataGrid1.TableStyles.Add(tab1);
this.dataGrid1.DataSource= DbHelper.GetDataSet(blah...blah).Tables[0];
this.dataGrid1.TableStyles[0].GridColumnStyles[0].Width = 50;
this.dataGrid1.TableStyles[0].GridColumnStyles[1].Width = 0;
this.dataGrid1.AllowNavigation = false;
this.dataGrid1.AllowSorting = false;
if( this.dataGrid1.VisibleRowCount > 0)
this.dataGrid1.Select(0);
Let me know if this works for you, in my case i am making the width of of 1st column to 50 and 2nd column hidden.
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|
|
Where is datatablestyles defined? I don't see it in the help of on MS's site. How is this class defined? If it comes from WebControls, I am working on a windows form.
Thanks for your help.
|
|
|
|
|
Peter8675309 wrote:
datatablestyles
I sincerely apologize for misleading you by datatablestyles. its actually
DataGridTableStyles. Its part of the System.Windows.Forms namespace.
Hope this helps, again i am sorry for the wrong class name fiasco!
"Creating tomorrow's legacy systems today.....
.... One CRISIS at a time!" -- Unknown
"If you build it....
.....BUGS will come!" -JB
this.Dispose();
"A Bug is a piece of <sup> code </sup> that knows whatz its purpose"
|
|
|
|