|
gamer1127 wrote: Can you suggest any good reading materials about parsing that can be found on the web?
Not really, I learned what I wanted to know about the subject before they invented the internet.
The "Dragon Book" by Aho, Sethi and Ulmann is pretty good. Its real title is "Compilers: Principles, Techniques and Tools" or so.
You can go two ways:
- use a yacc-like program, that reads a BNF description and generates lexer/parser code
- create your own special-purpose lexer/parser, where the methods are probably based on the BNF production rules.
The hardest thing in a parser is parsing expressions; in C-like languages expressions can be almost anything. Now if all you need is something that can find delimiters in a correct and practical code block with only simple expressions, you can skip a lot of stuff. But IMO you do need to handle comments, string literals, and escape characters.
I doubt you will come up with a real good general-purpose C/C++/Java/C# parser in a matter of days...
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.
|
|
|
|
|
Thank You Very Much for your inputs...Now I can continue creating my program..
|
|
|
|
|
No, string.Split won't include the delimiters. It can be done with a Regular Expression. (But you still won't be able to accomplish what you need.)
|
|
|
|
|
I completed a small project on StudentInformation System. I want to deploy in my friend college, Dear Help me, How i develop setup to deploy the software. Regards Iftikhar my emails is iftikharabc@gmail.com
045251
|
|
|
|
|
Well, you can create a deployment project in VS, or you can download a tool like Advanced Installer to help you.
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.
|
|
|
|
|
Follow these steps to start with simple deployment setup
1. Add New Project to existing project,
- on add new project window select 'Setup And Deployment' node, on right hand side you will find some of the template
select the 'Setup Project'[or you can select any other according to your convenience]
- Name the project and click OK
- The New project is added to the Solution explorer
- It also opens a 'File System' Editor
- There you will find three tabs
1. Application Folder - Base directory for your application, you should add all the required assemblies by your application here , exe as well
2. User desktop - you want to add Desktop Shortcut add it here
3. User's Program Menu - here you can link in the Start -> program files
- when you add shortcut for step 2 and 3 provide its target as your applications main exe
- now rest is almost same you need to rebuild and this which produces two files under debud/release folder under your setup project directory , these files are nothing but your installbles
I have just provided you with starting steps, you might want to go for some more details like adding icons, status bar icon etc etc
I Would suggest to look on net to explore it more , there are many articles dedicated to this
Reg
Deep
Happy Coding
|
|
|
|
|
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.
|
|
|
|
|