|
so a project is just a collection of classes?
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
A project is a collection of classes, but it's also more than that. Typically in Visual Studio, a Solution is a collection of projects. Each project would normally be compiled into an assembly (which is a DLL).
It's normal to break up an application in this way. You might have your front end in its own project. Maybe you've got some custom controls, they'd be in another project (so that they could be reused elsewhere). You might have some business functionality in another project, and certainly data access would be another one. All these seperate projects comprise your solution.
When you build your solution, each project is compiled into its own assembly and they are all placed in the same folder. (This is private deployment if you want to look it up).
Projects obviously need to know about each other, and this is where references come in. If you right click on one in VS, there's an add reference option. Here you can reference your other projects and also system wide assemblies from the GAC.
Hope that makes some sense.
Regards,
Rob Philpott.
|
|
|
|
|
As mentioned by Rob, there is a Connection Cache in ADO.NET. They are cached based on the connection string. So as long as you keep your connection strings the same, there is almost no overhead closing your connections and reopening them.
|
|
|
|
|
thnx
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Hi all !
i'm trying to do something with one of my button. I got a logon form and i want to change de "visible" status tu true if the logon is accepted. The button is in the main form so i tried something like this :
<br />
if (str33 == encpassword)<br />
{<br />
PassTextBox.Clear();<br />
<br />
ChangeButton.Show();<br />
<br />
Main open = new Main();<br />
open.ChauffButton.Text = "dfg";<br />
<br />
<br />
}<br />
but it dosent worked. I jsut dont get it. Theres no error, nothing seem to be wrong but the status dont change. I even tried to change de text and got no result
Can someone help me on this please ?
BTW i'm using VS express 2008
Thanks !
|
|
|
|
|
from your code i'm not sure which bit isn't working or what you want to work?
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
l a u r e n wrote: from your code i'm not sure which bit isn't working or what you want to work?
the
Main open = new Main();
open.ChauffButton.Text = "dfg";
part.
the text dosent change and if i change this by "open.ChauffButton.Visible = true;" it's not working either
|
|
|
|
|
|
Ok, you need to pick up a beginners book on C#. Firstly, Welcome to CP, check out the post at the top for some etiquette, specifically on "text speak", everyone hates it. It's the only universal truth. Now without knowing which control is what, and judging off your hungarian notation (naming variables based off their control type) I'm going to assume the following...
Firstly, that this code is executed on a button press.
Secondly str33 = sometextbox.Text which has a password in it
Thirdly, that encpassword is a plaintext password
Fourthly, that PassTextBox is a textbox
Fifthly, that Changebutton is a button that you wish to show ONLY when the password is correct
Sixthly, that open should pop up if the password is correct
Now this goes against all convention of not posting code, but this is just one that needs dire attention.
I'm going to go line by line and address some issues
if (str33 == encpassword)
{
PassTextBox.Clear() should be PassTextBox.Text = "" or you can use PassTextBox.Enabled = false or PassTextBox.Visible = false , they will all do some sort of desired effect, clearing the textbox, disabling it or simply wiping it off the form
ChangeButton.Show() should be ChangeButton.Visible = !ChangeButton.Visible assuming Visibility is set to false (which I assume because you are trying to show it)
Main open = new Main();
you have initialized a form here, but you never showed it
open.Show(); is what you need
From here open.ChauffButton.Text should work, I don't really remember because I never access controls like this, consider placing this code elsewhere like on the load event of your form 'open'.
Those modifications, and you'll be off to a start.
modified on Tuesday, February 3, 2009 11:44 AM
|
|
|
|
|
thanks for your answer EliottA
i will take notes of all you say
i realize theres a lot of infos i didn't wrote so that was not easy to help me. I will do better next time.
I will try to find a way to make it small and clear and understandable for all of you (i will find a good language translater LOL)
btw, i didn't get my answer (as i say, i realize you hadd no chance to understand what i try to do) but i will work on a way to put it more clear and more in standard form
|
|
|
|
|
Your answer is in there, I threw in the code you will need to make it work, infact I gave you multiple options based off the multiple assumptions I had to make. Most importantly, you forgot open.show() to show the form!!
|
|
|
|
|
thanks again EliotA for your answer
the point is i forgot to tell that the main form is already open so if i made a open.show(); i will have 2 forms open and its not what i whant. I already try a open.refresh(); to see if the text change and nothing appen, i also try a open.update(); and no result.
i think will follow your first advise, i think i will get a "c# for dummies" and learn the base to get the things a still dont get.
thanks alot again !
|
|
|
|
|
I have created an application to draw rectangle by using graphics..i got solution to resize,increase,decrease the rectangle..now i want rotate that rectangle...with mouse move events..(float angle should be dynamically)..
..i tried matrix rotation..but am not getting that how float angle will be generated dynamically by moving mouse...
plzzzzzzz Help me...
|
|
|
|
|
As was said the last time you asked this question...
Dragonfly_lee wrote: 1.listen the mouse click and move events.
2.Check the method - RotateTransform of Graphic object. E.g.
gfx.RotateTransform(rotationAngle);
Source[^]
|
|
|
|
|
ya i have seen that message..but rotation angle will be dynamically i want to mention..how should i calculate that rotation angle..when mouse moves on form..
|
|
|
|
|
well clearly he is saying that from the mouse click you can get the point where it was clicked ... then you can track the movement from that point to figure out a direction and hence the angle no?
i think...
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
try storing the initial mouse click position then use that point, along with the center point of the object and the current mouse pos and use pythagaros (not sure on spelling) thery to calculate angle base on three point, oh you will also have to calculate the distance from points
My opinion is... If someone has already posted an answer, dont post the SAME answer
|
|
|
|
|
I'm starting a new project which will run a WinForms user interface.
I want the interface to be modular and make good use of code refactoring but it seems this is near impossible with Winforms C#.
At first I evaluated Smart Clients and found that it is exactly what we need, but given our time and resource constraint, it was not a viable solution.
Is there a best practice to create a windows application with seperate panels? Preferably, these panels should be able to contain any specified user control or form.
Every solution I ended up with so far came down to massive code duplication.
|
|
|
|
|
evilnoodle wrote: I want the interface to be modular and make good use of code refactoring but it seems this is near impossible with Winforms C#.
How so?
Have you looked at the CAB stuff in the Enterprise Library? Not that'd I recommend that...
Regards,
Rob Philpott.
|
|
|
|
|
Hi all,
I have a form with a datagridview, a button named "View" and a button named "Update". When i click the button View, datagridview will show all data from database named B sucessfully. Then i can modify or delete or enter new data into datagridview.
I wonder how to update database from datagridview when the button Update is clicked. I try some code but it did not work:
...
myDataSet.Merge(DataSetChanged);
adapt.Update(myDataSet);
// inform the user
label1.Text = adapt.UpdateCommand.CommandText;
Application.DoEvents();
myDataSet.AcceptChanges();
dataGridView1.DataSource = myDataSet.Tables[0].DefaultView;
Regard,
|
|
|
|
|
Do Events, really?
I believe you need to set the data adapter's update, insert, and delete commands for it to work automagically.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
I don't know how to put insert, delete, update code as you said. I'm just a beginner. Please tell me more if it's possible. Thanks for your help!
|
|
|
|
|
Oh, i find out how to do that. thanks for your help!
|
|
|
|
|
is there any special way of retrieving data from a huge database , because i've developed an app that reads from database and returns a dataset.then in the app using the dataset i fill a listview with each record in dataset. when the records increasing in the DB the time taken to fill the list view also increasing,(i'm using a simple select * query) so i want to reduce this time .
yasith
|
|
|
|
|
Break it up into chunks using LIMIT keyword, that way your application has less to retrieve per each view. You can put a simple button to go to next page etc.
|
|
|
|