|
Oh man, FXCop... that brings back (painful) memories....
I used it about 6 years ago on a team with lots of junior developers (and senior developers who thought they were above adhering to conventions). It was effective, but comes with a lot of overhead.
On a team of competent developers, I much prefer a document describing the style convention rather than a tool that enforces it. Come to think of it, I prefer teams of competent developers outright
|
|
|
|
|
I didn't say I would use it through choice
Like you say though, for juniors in particular it can stop some bad habits (and introduce some different ones ), so I thought it may be of interest to the OP
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Same form runs every time i run even if the address provided is changed in the program in c sharp. Plz help
|
|
|
|
|
Well that is one of the most obscure questions I have seen this week.
What is this address you are providing?
What are you providing the address to?
You seem to be confused between data and application. I presume an address is data and the form is coded, if so address does not define a form but the data in the form.
Try stepping through the code and inspecting the value of the variables as you progress, this will tell you what you are getting instead of what you expect to get.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Well that is one of the most obscure questions I have seen this week.
Well it is only Tuesday (here), so there's plenty of time to beat it
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
when login credential are succesfull i want to show mdi form and close login screen. in VB.net i have done it simply as below and is working fine:
Me.Dispose()
Me.Close()
AttendanceMDI.ShowDialog()
in c# i did it like
this.Dispose();
this.Close();
AttendanceMDI.ShowDialog();
but it closes the application
plz help....
|
|
|
|
|
Use Show instead of ShowDialog and just hide the login form after the call to Show method.
Do not close or dispose the login form.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
The login form should NOT be your startup form. The MDIParent form should be the startup and if it finds that the user needs to login, it shows your login dialog.
|
|
|
|
|
Hi. Whenever internet explorer opens a window should popup. I am want to do this using dotnet. Please help me. How to identify internet explorer opens using dotnet code?
|
|
|
|
|
I guess a windows service that will regularly check for iexplorer.exe in the processes running on a system should work. If, it finds the process, start your windows application then.
I also think you can probably make your application as IE add-in. You can find help creating add-in here[^].
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi, I am new at this so please go easy on me...;)
I am working on a treeview control in visual studio 2008 using visual basic. I am trying to populate the treeview with data from 2 sql database tables. I am able to populate the parent nodes but cannot populate the child nodes at this point. [Note: With my data, Parents are "Firms" which are stored in the Firm's table and Childs are "Funds" and are stored in the Funds table. The two tables are related using a FK with FirmID connecting the two tables].
My code to populate the parent node is as follows:
'populate the tree view control
TreeView1.Nodes.Clear()
Dim ParentRow As DataRow
Dim ParentTable As DataTable
ParentTable = FirmFundDataSet.Tables("RAInput_Firms")
For Each ParentRow In ParentTable.Rows
Dim ParentNode As TreeNode
ParentNode = New TreeNode(ParentRow.Item("FirmName"))
TreeView1.Nodes.Add(ParentNode)
Next
The ultimate goal of my project is to use the treeview as a way to navigate other forms in my project.
I have seen some examples on the web that show a solution were you relate the two datatables (e.g. dataset.Relations.Add(etc)) and then use some code like the following to add the child nodes. This does not work for me because I get an error that states that a relationship already exists between my tables (note: I added a relation in vb to tables that are related in sql, so this kind of makes sense. Not sure how to work with an existing dataset relationship though).
''''populate child'''''
Dim childrow As DataRow
Dim childnode As TreeNode
childnode = New TreeNode()
For Each childrow In parentrow.GetChildRows("FirmToFund")
childnode = parentnode.Nodes.Add(childrow(2))
Next childrow
Any help would be appreciated.
|
|
|
|
|
Hi All,
I am using help provider control.
my requirement is when i press F1 i should get the .chm file -- I done
but my .chm file should highlight the "Index" part as the default however, I want to highlight the "content" Tab not the "index" Tab.
For example if i am seeing the customer form and when i hit the F1 it should highlight the Customer page which is in the .chm file
Thank in advance
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
I need to be able to resize my form but i don't want the ControlBox to be visible...
I've tried set ControlBox = False, FormBorderStyle = Sizeable, and Text = (Empty)... But i still could see the small thin border surrounding the form.
I need to make it completely disappear, just like when using FormBorderStyle = None
Is that possible???
Please helpppp
Thanks
|
|
|
|
|
Not without digging down into some ugly Win32 APIs. Why not set the FormBorderStyle to None and write your own resize code?
If my answer has helped you, one of my articles may also be a help. Also remember that your best friend's name is google.
|
|
|
|
|
hi All
I am new to window application.plz help...
I want a datagridview in this I will have a row and "add" button in the last colomn,
when i click the add button same row should repeat.And if i want to delete it should be possible(window application)
Please help me with this.
thanks in advance
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
You can use DataGridViewButtonColumn to add buttons to your gridview. Then, handle its click event to insert/delete rows.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
This question has been answered so many time and so well covered this may help you[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm back at it, trying to build an app to manage substation equipment. I had to take a little break to design a substation and some new sewer plant motor control circuits, but I'm back at it and still confused. Before you tell me to read a book, I have read two, and ordered another. But the third book won't arrive until Friday, and I have a five day weekend for the Thanksgiving holiday I'd like not to waste. I've also reduced the scope of the problem to manage one kind of device, instead of tackling 4 different types with entirely different information to manage. I figure that if I can get one to work, it won't be nearly as hard to expand as it would be to write it all at once.
I have a SQL Server DB with several tables - a master that holds equipment information that is invariant, a status table that holds information about the current location, last service date, and number of operations since last service, and a pair of tables to hold the histories of readings taken and services performed on each device. I have created a boilerplate app with a main form, and that form has a menu to allow the user to Add, Edit, Move, Service, Read, or View devices. I know this is easy to anyone who does it all the time, but I am well and truly stuck for ideas about where to go from here.
I've tried before to use a sequence of forms, hiding and showing them, to walk a user through a few pages of data entry, but it turned out to be problematic to transfer the data between forms. I've tried using dialog boxes for each step, but had similar problems. I tried using data-bound controls on each form but that quickly became a nightmare, so I'm leaning toward a solution that has the main form collect all the data, then pass it off to functions that update the database. Besides, I believe the separation of data functions and user interface makes good sense from a maintenance point of view.
Is this a place where a MDI is appropriate? Or is the idea of using multiple forms in sequence a better approach? Or should I stick with one form and change the visibility of controls as the user moves through the process. I'm lost here. I think the question is one of architecture, rather than procedure or actual coding, but I don't know if I'm even asking the right questions yet. I've read lots of stuff about making and using forms, but not one example of using two or more in the same app has appeared anywhere I've searched. That leads me to believe that I'm barking up the wrong tree entirely, and there's some secret method used by almost every modern program I've used that isn't written up anywhere. Any book can tell me how to make a form, and I have several that do, in multiple languages. But not one of them mentions movingsfrom form to form, persisting data along the way, until the time comes to save the data from all of them.
Can someone get me started? Pretty please...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Wrong forum so consider yourself .... Excoriated, where the bloody dictionary when I need it.
The is definitely a design issue and we all have our favourite flavours. Here is mine, caveat most of my apps a batch management so no transactions to speak of.
Main form with a navigation control on the left, menu for methods not based on a specific piece of data (exit, process, help and reports), an icon strip for CRUD keys
Changing selection in the nav control populates a list in the main body of the form. From the list you pop a dialog ALWAYS, never edit in a list control. You can either pass an ID or an object to the dialog in the constructor. Your list has the ID of the records you want to work with so I pass that to a dialog designed to work with that object.
When the dialog is opened it inspects the ID passed in, if you passed a 0 (ADD) then it gets an empty datatable from the database, if there is an id (EDIT) then it gets that record from the database. The class that gets the datatable (designed for that object) also populates the object. I then bind the form to the object. When the user edits the form the data is passed to the object via the binding.
When the user saves the dialog I write the data back to the database and return DialogResult.OK to the main form and closes.
Main form detects the OK and reloads the list control with the new record.
I rarely need more than 3 levels of nested dialogs for any operation.
BTW, Last Serviced date is redundant on the Tool table, Select top 1 from service table should do it. Otherwise you need to reconcile between the last service field and the service table, what happens if someone deletes a service record?
|
|
|
|
|
Thanks for some excellent advice! It actually makes sense to me.
One of the approaches I first considered was to make a master page that spawns dialog boxes to collect information, then passes the result back to the main form. I forget why I abandoned it.
As for the forum choice, my other choice was general programming, and it had more cobwebs than visitors last time I looked.
About the last service date... I had planned to update a device status table with that info every time a service is performed in order to provide a concise, small table that I can use to give users a quick, easy report to show which devices are nearing a service appointment. If a service record gets deleted, no big deal - the critical data is recorded elsewhere. Similarly, whenever a new reading for the operation counter of a device is entered, it's cumulative operations since the last service will also be stored in the status table. These devices are good for about 50 operations before they fail if service is not performed, so this information has to be really easy to find. At $18,000 each, we don't keep many spares on hand, and can't afford to lose one!
BTW - My new book arrived today - Programming Microsoft SQL Server 2008 - and it looks fairly complete. All the code is written in C#, too, rather than the VB I don't have any interest in learning at the moment. It's looking to be a fun weekend!
Thanks, again!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Roger Wright wrote: it had more cobwebs than visitors
True, the reason you got a sensible reply (although posting here is the reason there is bare)
The reason NOT to use the service date on the tool record is that it sets a bad habit and will lead to disaster, sooner or later the auditing of the related data is going to be critical and if you have it in 2 places (tool and service) then reconciliation is an issue. This is a BASIC tenant of database design, called normalisation, no data should be stored in more than one place. There are exceptions but they are EXCEPTIONs.
|
|
|
|
|
|
i have windows form (.net 3.5) and have to access data from database that is located on a remote server. how can i do it? plz help. can i do it with webservice. if yes then tell me how to access the webservice.
Thanks!!!!!!!
|
|
|
|
|
Just as you would do for the local one. Write the connection string and use its Open method. Just make sure your database allows remote connection.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
DON'T ask the same question in multiple forums. Identify the most appropriate forum for your question and post it ONLY there.
|
|
|
|