|
Ok I have tried several different ways to get this to work but either i am confused at what causes the build version to increment and how to retreive that value at run time.
Questions:
1) I want the application to increment it's build version automatically with each compile. How is this possible?
-THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0.
2) Once I get the build version to auto increment how do I retrieve that version number.
Here is some of what I have tried....
System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;
//System.Version version = System.Reflection.Assembly.GetExecutingAssembly().
System.Diagnostics.Debug.WriteLine(String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));
//System.Diagnostics.Debug.WriteLine(Application.ProductName.ToString());
//System.Diagnostics.Debug.WriteLine(Application.ProductVersion.ToString());
//System.Diagnostics.Debug.WriteLine(Application.CompanyName.ToString());
//System.Diagnostics.Debug.WriteLine(A
lblAppVersion.Text = (String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));
System.Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.;
//System.Version version = System.Reflection.Assembly.GetExecutingAssembly().
System.Diagnostics.Debug.WriteLine(String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));
//System.Diagnostics.Debug.WriteLine(Application.ProductName.ToString());
//System.Diagnostics.Debug.WriteLine(Application.ProductVersion.ToString());
//System.Diagnostics.Debug.WriteLine(Application.CompanyName.ToString());
//System.Diagnostics.Debug.WriteLine(A
lblAppVersion.Text = (String.Format("{0}.{1}.{2}.{3}", version.Major, version.Minor, version.Revision, version.Build));
|
|
|
|
|
1 - the only way I've found to do that, is a post build step that runs an exe that changes the app.config file to increment it
2 - I think what you have should work.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
This would be what I am trying to accomplish.
Any suggestions on a exe that does this or do you have a sample blueprint one so I don't have to invent the wheel?
thanks.
So Essentially I will need to manually make sure the build version is set before compiling. Correct.
|
|
|
|
|
Just to be clear you want the publish version that is stored in the manifest from the
publish page in project properties.
versus the assembly version from the assembly information sub form on the application page.
all the code you have tried the results come from the assembly information.
|
|
|
|
|
I want the value that identifies the exe's version for the application. But I want the exe's version to increment each time it compiles so that when the application is running live I can identify if the end user is using the most current version released. And if not to know what specific build version they have.
|
|
|
|
|
<1) I want the application to increment it's build version automatically with each compile. How is this possible?
-THe Publish Version I can increment when I compile it in the build menu as publish. But the application goes thru the inhouse setup application with C#. So my first question would be how to increment the build version with each compile. As all my results keep bringing back 1.0.0.0.
Check out:
http://autobuildversion.codeplex.com/[^]
|
|
|
|
|
Perfect thanks.
|
|
|
|
|
Glad to help!
I agree, it's a feature that's badly missing in Visual Studio 2008.
I also modified a C# backup zip program that I found to do a backup of my current project with the date and time appended to the zip file.
For under $100, you can get 1TB of external storage. So, IMHO, there is no reason at all not to save TONS of versions!
Good Luck!
|
|
|
|
|
Hi Everyone,
Firstly, I think this may be my first post here, but I have been following the code project for quite a little while, and have had an account for almost just as long: one of the best resources online!
Anyway, one thing that I just can't seem to work out, a rather simple problem, is changing the default form that is opened when a WPF program is launched. I can do it in Windows Forms without a problem, but I can't seem to find where to do it in WPF.
All help and input is greatly appreciated!
- Josh
|
|
|
|
|
Look in Program.cs, there you shall find your answer!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Oops, sorry, missed it was a WPF question.
Look in App.xaml, line 4, the StartupUri property!
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Thanks heaps for that, it is a great help!
|
|
|
|
|
Dear Sirs:
I have searched numerous articles online and in the built-in help file but can't find an answer to this anywhere.
I have a C# WinForms application with a ListView control named "lstVwAddress", containing 4-columns, i.e., "FirstName", "LastName", "Email", and "Phone".
My form also has 4-textboxes with the same names, i.e., "txtFirstName", "txtLastName", "txtEmail", and "txtPhone", for which the user can enter data and save it to the database.
My application has a SQL 2008 Express database with a simple "AddressBook" table with an autoincremented column, i.e., "AddressID" and columns for "FirstName", "LastName", "Email", and "PhoneNumber" fields.
It also has an "AddressBookDataSet" and an "AddressesTableAdapter".
What I would like to know is how can I loop thru and retrieve data from each row/column in the database and use it to populate the ListView's ListItem and SubItem's. I don't need to retrieve the autoincremented ID column, just the remaining ones.
I'm also not using any type of data-bound controls.
I can successfully Insert data into the table but need to know how to retrieve and populate the ListView's ListItems and subitems. Also, can I use the existing TableAdapter, or do I have to declare separate data objects to retrieve this. My TableAdapter's query is "SELECT FirstName, LastName, Email, PhoneNumber FROM dbo.Addresses"
I have tried researching this on the Internet but can't find any good examples. The examples listed were either for a data-bound control like the DataGrid or were for VB.Net and not for C#. The examples found in the built-in help file all showed manually populating the items at design time instead of pulling the data from a SQL database. Please help.
Thank you in advance.
|
|
|
|
|
For each row you read, build a list view item and populate the sub items, one row at a time.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello Christian:
Thank you for responding to my post. I have 2-questions for you regarding your suggestion, i.e.,
"For each row you read, build a list view item and populate the sub items, one row at a time."
Can you supply an example of the syntax I might use to accomplish this?
Can I use the existing TableAdapter "AddressesTableAdapter" to open the connection and run my Select query, or do I have to work with different data objects, i.e., connectionString, dataTable, dataRow, even possibly a dataReader object, etc.
Thank you again.
Richard
|
|
|
|
|
Ok, here is what I tried and it DOES populate my listview's ListItems and SubItems.
private void myRemoteAddressBookForm_Load(object sender, EventArgs e)
{
displayDataInListView();
}
private void displayDataInListView()
{
this.addressesTableAdapter.Fill(
this.addressBookDataSet.Addresses);
foreach (DataRow dRow in addressBookDataSet.Addresses.Rows)
{
foreach (DataColumn dCol in addressBookDataSet.Addresses.Columns)
{
if (dRow.RowState != DataRowState.Deleted)
{
ListViewItem lstItem = new ListViewItem(dRow["FirstName"].ToString());
lstItem.SubItems.Add(dRow["LastName"].ToString());
lstItem.SubItems.Add(dRow["Email"].ToString());
lstItem.SubItems.Add(dRow["PhoneNumber"].ToString());
lstVwAddress.Items.Add(lstItem);
}
}
}
}
However, for testing purposes I added only 2-entries to my database, but the listview displays 5-duplicate entries for each of the 2-database entries.
I know I must be close; at least I'm populating the ListView now.
From this code, can you see what is causing the duplicates to appear in the ListView?
Thanks again for your suggestions.
Richard
|
|
|
|
|
Alright, I finally figured it out.
I remmed out the lines dealing with the DataColumn and it works properly now, without any duplicates.
When I studied it I discovered that by having the lines:
foreach (DataColumn dCol in addressBookDataSet.Addresses.Columns), for which there were 5-columns including the autoincremented ID column, I was actually telling it to return the resultset times the number of columns.
Oh well, one learns as they go along.
Thanks again Christian Graus
Your suggestion was the key to getting this to work.
Muchas gracias
Richard
|
|
|
|
|
I am making a basic inventory tracking program for my wife's small business. I am looking for a way to keep track of each sale she makes. Right now, I have a form that pops up asking for customer name and date of sale. I want her to be able to pick how ever many products she wants from a list of products that I have stored in a table in the same database. Then I need to take all of those products and prompt the user to enter the number purchased and prices for each. I am struggling with the best way to do this. As you might suspect, I am learning C# solely for this purpose, so I am very beginner. Thanks for any help.
|
|
|
|
|
Show the items in a listview or a gridview. They will have events for double click, and properties for selected items
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
dear all im wondering how to use the openCv libray with c#
could any one help me please..
|
|
|
|
|
Hi,
this site has a large collection of articles and a reasonably effective search engine. You can easily find what you want in one try.
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 alot for your help
|
|
|
|
|
You write code. If you want a more specific answer, ask a more specific question and show some signs of caring enough about the answer to have tried to find information yourself.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
well actually iam trying to make a program that will track the lips of human then read this lips..
so when i was reading its said that i should use openCv library in order to track the lips using special methode,
so my question is how to use this library with c#2003 or 2005...
|
|
|
|
|
I am willing to bet that you're not going to be able to do this.
In any case, it's a dumb question to ask here. You should find a forum dedicated to this library and ask it there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|