|
The application uses the username and password that the user provides, not a default system account. Therefore it picks up the database security/permissions to tables/views etc.
Any thoughts about securing the connection string in this sort system.
Thanks
|
|
|
|
|
Build your connection string externally and use tokens for the username and password that can be replaced through code before they are used. I like to use [%USERNAME%] and [%PASSWORD%] as my tokens.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
At the moment I have a private member variable with I store the connection string in. I make this variable accessible through a public static property.
What are the benefits of using the token methods?
Is the static property a good or bad way to store the connection string.
Getting back to the orignal post what do people think good practice is for handling database connections?
|
|
|
|
|
Are there any converters for C++ to C#?
I googled but didn't come across any.
Anybody know one?
Don't and drive.
|
|
|
|
|
- code converter ? the whole point of the CLR (Common Language run-time) is to make assemblies interoperable. Build one with MC++, another using C# and also using the first assembly. IJW!
- automatic method call converter (better known as P/Invoke) ? Not yet. Here is an interesting site[^].
|
|
|
|
|
.S.Rod. wrote:
code converter ?
Yes. Actually I need to convert the existing VC++ project to C#.NET
As I am newbie to C#, it's giving me lot of headaches.
.S.Rod. wrote:
Build one with MC++, another using C# and also using the first assembly. IJW!
Any samples?
Don't and drive.
|
|
|
|
|
Kant wrote:
Yes. Actually I need to convert the existing VC++ project to C#.NET
As I am newbie to C#, it's giving me lot of headaches.
It's good to learn, but unless it's real work, you might uselessly have to cope with structures that in C++ world are tightly coupled with memory and buffers, while .NET and C# in particular provides less access to it. (in practice, you can do anything you want, just like with C++, but you need to go pretty much hardcore and doing so there is no point in doing C# at all).
In case you want to go on with brutal code conversion, don't hesitate to have a look in MSDN first. There are a few interesting type mapping tables to learn.
Kant wrote:
Any samples?
There are simple steps.
- start VS.NET, create a MC++ user library project. Add your code. Get the assembly compiled. Let's call it Assembly1.
- create a C# project, for instance using the Windows Application template. Add a reference to Assembly1, and add using Assembly1; in your code. Doing so, automagically intellisense brings you all types from the Assembly1 metadata. Add code, compile, run. You've got your first language interoped sample!
A sample of MC++ mix mode ? Nish has one[^] for you.
|
|
|
|
|
Thanks S. Rod.
Are you by any chance MCP.net?
If not, by your replies in this board you deserve to be
Code Project MVP.net...
Don't and drive.
|
|
|
|
|
Yep, S.Rod. is definetely the man.
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
Eh eh, the only label I would accept is Bill Sergio's son. Just kidding, bwahahahahahahaha!!!!
Seriously though there are so many MCPs or whatever so-called experienced guy around, that there is no point any longer in being one. Often they are experienced, but I wonder whzt it brings them in the end. It is my experience that diplomas or labels are one thing, and the ability to communicate is another. What brings value is, and this is not going to change anytime soon, is a good asset of relations and friends in other companies.
|
|
|
|
|
I've installed VS .NET on my machine. As I started up .NET, the Startpage only shows "My Profile" on the left menu. I was used that the last opened projects were listed on the right.
The settings for the startpage are correct. Setting "Reset Window Layout" does nothing change.
Does anybody know how to solve this problem or to reforce VS .NET to show the correct entry-page?
Thanks!
Stefan
|
|
|
|
|
um, under tools and options, and in th Enfironment under General, there is a drop down with a heading of "At startup:" and you can specify the last loaded solution.
I hope this is what you need.
"When I was young we had a quicksand box - I was an only child, eventually" - Steven Wright
|
|
|
|
|
When I try to access Excel 2000 cell values from my applicaton I allways get the same result - "System._ComObject". What is it??? How can I get the cell value itself?
What I do is
ExcellWorkbook.Names.item(22,0,null).RefersToRange.Cells[1,1].ToString()!!!!
|
|
|
|
|
.Value ?
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I think it's actually .Value2...
|
|
|
|
|
ah, silly me
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
What were you thinking? Who could possibly expect that the value would be stored in "Value"?
|
|
|
|
|
I guess thats why I'm not allowed to design frameworks...
p.s. how is this going to be handled in .net? is their an artical dealing with how the framework will handle this?
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Hey guys,
I'm trying to develop a C# User Control that allows me to send key events. I can use SendKeys.Send() no problem, but it focuses the button so that the button recieves the keydown/keyup/keypress events. I've tried to make my own button and override WndProc(). I'm blocking WM_FOCUS = 7, but no luck. Does anyone have an idea?
Thanks,
Steven
|
|
|
|
|
For the moment I've used labels, SendKeys.Send() and onClick for the labels. Let me know if anyone finds a better solution with buttons.
Thanks,
Steven
|
|
|
|
|
I have a question reg. the .config files.
I know that by using the .config file you can redirect the application to use a different version of an assembly or look in a different location for an assembly.
Do we have to use same public key which the application expects? What happens if I don't provide it?
Don't and drive.
|
|
|
|
|
if you are loading dynamically,
use Assembley and then check version, and major, minor .
need to compair versions and based on that u load that.
check Reflection and Emit classes.
|
|
|
|
|
I've been reading up on delegates and events lately and I'm really confused as to what the event keyword does. Does it actually do anything?
For example, I have this piece of code inside my class:
public delegate bool Validator(char c);
Then I define two members:
protected Validator dVal;
protected event Validator eVal;
And I use them:
dVal += new Validator(Char.IsDigit);
eVal += new Validator(Char.IsDigit);
How is eVal different than dVal ? They both behave identically.
I appreciate your enlightenment.
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|
|
|
Thanks Eric. It's nice to hear the answer from the source.
That explains why I couldn't get something like textBox.KeyDown.GetInvocationList() to compile.
Great articles, BTW.
Regards,
Alvaro
When birds fly in the right formation, they need only exert half the effort. Even in nature, teamwork results in collective laziness. -- despair.com
|
|
|
|