|
Using the root account for application access in any DB system is a very high security risk and doing so will probably get you fired as a developer.
Create an account in the DBMS specifically for your application to use and give it permissions to only the objects and accesses that it needs.
Does it make any difference in performance?? No. It's just an account that provides access to things.
Does it effect the security of your application?? No, but it DOES effect the security of the data you put in the database(s).
|
|
|
|
|
Jassim Rahma wrote: do you recommend to use the root as user
Definitely not.
Jassim Rahma wrote: or create a different user
Yes.
Jassim Rahma wrote: or have a separate MySQL user for every user in the company?
No.
|
|
|
|
|
Hi all,
I was just reading the following article Introduction to NUnit... and was introduced to Attributes.
I'm a noob so I've never seen this before or read about it. I understand that it allows you to define metadata within your program and so on...
My question is more so about format than understanding. I was wondering if I put in an attribute right above on function if that attribute is assigned to all functions below it until another attribute is reached.
For instance:
[SetUp]
public void init()
{
Person person = new Person();
}
public void foo()
{...}
Will the attribute [SetUp] be for both init and foo, or just init?
Thanks,
Jeramy
|
|
|
|
|
The [SetUp] attribute was placed above init - consequently, only the function init has that attribute.
By the way, with NUnit, you need a [TestFixture] above your class declarartion, a [TestFixtureSetUp] for the test setup method (if availbale), and a [Test] for every actual test method - the attributes differ between Microsoft Test and NUnit. You can use Visual NUnit for running your tests from Visual Studio (has some bugs, but it's still easier than using the NUnit GUI).
|
|
|
|
|
Hi all,
I am passing a string parameter to one of the method of web service.
This string parameter has /r and/n incorporated in it, but when value is passed to web service it removes /r from it.
Any reason why is it happening so.
Web service is created using .Net framework 1.1 and written in C# code.
I am trying to consume web service in an another application build using framework 1.1.
Rock Star
|
|
|
|
|
Do you have the source code of that web service?
Is it running on some OS where new lines are not \r\n but \n only? (Assuming that you actually meant \r and \n when you wrote /r and /n...)
|
|
|
|
|
If you want to have the \r and \n come across as literals (not return and newline), then you need to escape them before they get to the server. You can do this in two ways, either:
string escapedString = "This is my escaped \\r and escaped \\n value";
or
string escapedString = @"This is my escaped \r and escaped \n value";
|
|
|
|
|
Probably depends on what "parameter" means but presuming that you really do have a web 'method' and you are passing data in the body, not url, and the server is discarding it then there is nothing that you can do on the client side that will stop that unless you can find a server side feature that allows it.
As per the other suggestion the server might allow escaping but that won't help unless it actually converts the value to the appropriate character. If it doesn't then it will return with the escape intact which won't help you.
Of course if you can modify the server then that would solve it.
|
|
|
|
|
I am writing a new C# 2010 desktop applicaton. I am using some of the exsting code in another C# 2010 application to start the new application since I will be using alot of existing code that works. I basically want to have a desktop form where the user can enter some data and return to the statement after 'Application.Run(new RejectForm());' listed below.
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new RejectForm());
}
I would like to have the data that was entered in the form be available to the application at this point.
Thus can you tell me the following:
1. How can I return to the location right after the Application.Run(new RejectForm()); statement?
2. How can i have the values that were entered on the windows form be available for the rest of the application to access from this point?
|
|
|
|
|
Not sure I understand fully, but here goes. Application.Run sets up the message loop which 'runs' the form, so when the form is closed that statement ends. Normally the application terminates there as well.
If you want to do some post processing create properties or retrieval methods on the form then just access them after the Run method has completed. When main() ends, so does your application.
Regards,
Rob Philpott.
|
|
|
|
|
static void Main(string[] args)
{
using (var f = new RejectForm())
{
if (DialogResult.OK == f.ShowDialog())
{
string someValue = f.TheValue;
}
else
{
}
}
}
You'd need public properties in your RejectForm , similar to the code below;
public class RejectForm: Form
{
public string TheValue
{
get { return theValueTextBox.Text; }
}
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
How would you incorporate the code you listed above in the windows form and then have the code return to the main method?
|
|
|
|
|
classy_dog wrote: How would you incorporate the code you listed above in the windows form The first part goes into "Program.cs"; you can see the Main-method. The second part of the code goes in the form you're trying to show.
classy_dog wrote: and then have the code return to the main method? That would happen automatically; when an application is run, the Main-method is executed. The code as presented would display a form (modal), and continue execution on the line after the "ShowDialog" call, as soon as the form closes.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
There is one more thing to that. You would have to put
DialogResult.OK; when you want to close Form, in order to
DialogResult.OK == f.ShowDialog() be true.
Best regards,
|
|
|
|
|
As specified in above comment, I neglect to mention I'm assuming an "OK-button" on your form, with the property "DialogResult" set to "OK".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi folks,
What I need is some guidance on what .NET namespaces o classes or whatever may be helpful to accomplish what I need to build.
Basically I have to build an Desktop (or Web) application capable of loading a C# Windows Form file and display it to the user just like (or similar as) we developers see it in the VS Designer.
Once open, the user must be able to click on any of the visual controls and set some properties for the the control. These properties are not the native control properties we set at design-time but specific properties of my application (e.g. user-role allowed to see that control when the form is executed).
Hopefully I explained well enough for you to get the idea.
I'll really appreciate your help.
Thank you
-FJ
|
|
|
|
|
CodeProject has an article[^] on the subject
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you for the quick response Eddy.
I'll check it out and hopefully it will be of good help.
Although I'm seeing the files it loads/saves are in a proprietary format, not the regular .cs files we load within VS.
Anyway I'll check it out.
Thanks again.
-FJ
|
|
|
|
|
Take it from somebody who has just done this, it is NOT a simple task, not by a long shot.
While it is true that you can make a rudimentary designer and save it to a proprietary format, if you want to be able to load .cs and .vb files, edit them, then save back to .cs or .vb then you need a LOT more back end. You need to make CodeDOM serializers, Parsers, resource services, event binding services, toolbox services, type resolution services, undo/redo frameworks, etc. My forms designer is probably 10k lines of code and took a lot of headaches and back-and-forth to get to where it is.
The biggest help I can give is to look at open source IDE's like SharpDevelop and MonoDevelop and see how they implemented them. Be wary though, the code can be very difficult to understand because of the way they intermingle with the IDE. It will give you a base on which to go though.
Good luck, trust me you'll need it.
|
|
|
|
|
Thank you Ron.
No doubt at all that it will take A LOT of HARD work to get it done just like you describe it.
My hope was (or is) that since I only need to load a .cs and paint it on screen to allow the user to click and select the visual controls to specify, for example, what user-role can see that control when the actual form is executed, the work required won't be that complex. The user won't be able to change anything on the loaded form itself. He will just set some properties that I'll save in a database, so when the form is executed I'll query the database to act according to the properties specified by the user (e.g. show/hide controls according to user-roles).
Thank you for your advise and good wishes ;o)
-FJ
|
|
|
|
|
If you just want to set some properties of a control and save it for use later that's a different approach, you don't need to design a forms designer for that, just implement a property window using the built-in PropertyGrid control, then save the edited property values to the database. You can google for C# Moveable Controls and stuff like that, searching on Forms Designer will probably point you in the wrong direction.
|
|
|
|
|
Maybe I wasn't clear enough in my first post, but yes, I don't need to build an application to design forms. What I do need is an application that can load and show on screen real .CS forms created by a developer. And administrator user will be the one using this application. What for? to set some, for example, user-role permissions for any of the visual controls of the form so the final user will or will not be able to see or access those controls when he, the final user, execute that form.
So, even though I don't need my app to be able to design forms just like the VS IDE does, I do need it to be able to load/show real VS Forms in a kind-of-designer window that let the Administrator User set privacy properties (using a PropertyGrid of course) for the buttons, textboxes, etc, in that form.
I hope it is clearer now.
And again, I appreciate your help.
-FJ
|
|
|
|
|
Hi,
I am developing a keyboard for using C#. I want to know how can I make the Backspace button invoke a Backspace, Delete button invoke a Delete, etc...
Technology News @ www.JassimRahma.com
|
|
|
|
|
I would guess that when you press the backspace button it sends a message containing the key code for Backspace. But your question is not entirely clear.
Use the best guess
|
|
|
|
|