|
Hello everyone,
I have a problem with my Settings
I want to save my connection string in the Settings.
I initialize a form and fill the textbox:
<br />
Settings.settings = Settings.Default;<br />
tb_ConnectionString.Text = settings.ConnectionString;<br />
I can change the string in the gui:
<br />
settings.ConnectionString = tb_ConnectionString.Text;<br />
Now, everything is fine. For testing I changed the connection string in the gui and this changed string appears in the settings.
I changed the connection string in Visual Studio back to the correct string.
This string appears in the settings, in the Settings.Designer.cs as the default value and of cause in the App.config
Now I start the project again an while initializing:
<br />
Settings.settings = Settings.Default;<br />
tb_ConnectionString.Text = settings.ConnectionString;<br />
setting.ConnectionString is wrong. It is the old/changed string
I removed the setting key, recompiled, added again the connection key to the settings but again the old connection string.
I searched for old string in my project but found nothing.
Restart of Visual Studio...again th old connection string.
How does VS get the old connection string and how can I avoid that?
Thanks for help.
KCT
|
|
|
|
|
I believe the config file is in your application settings folder, not your build folder.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I found the problem...the feature
It is a user config and there was an old one in the application directory of the user profile.
Thank you for your help
|
|
|
|
|
Can I get my C# code to recognise that the user has UNSELECTED an item in a list box so I can the do something with the Index.
My code is handling the SELECTING of an item correctly and adding the selection to a database table.
If they then unselected the same item how could I detect this and delete the selection off the database.
Is there an UNSELECTION_INDEX_CHANGED type event handler?
Thanks in advance
|
|
|
|
|
Hi,
there isn't such an event. As the SelectedIndexChanged event is also fired when something is getting unselected (as far as I know) you could always compare which indices are newly selected or unselected.
Robert
|
|
|
|
|
there is nothing to check for 'unselected'. you will have to use 'selectedindexchanged' and will have to keep track of the previous indices. you can do so by temporarily storing their values in variables.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
i want to implement cache mechanism in C#
as i have to access data from the database each time i would like to implement cachememory to store all the data into it once after that i want to access from it.
But i don't know how that can be implemnted in C#
please help...
|
|
|
|
|
|
Hi,
I have made a setup project in VS2005. It has some pre-requisites. When i compile it in Release mode, it generates a folder for each of its pre-requisite. What i want to do is to package all the files,folders and other things in a single file which the user could click to start installation. Is there any way to do it in VS2005? If not, can you suggest some third party software for this purpose?
Sorry, A little piece is left that is how to pass command line options to the EXEs of the pre-requisites those are generated when the setup project is build in the release mode.
Accept my advance thanks for your help, suggestion or even just comments...
Wasif Ehsan.
-- modified at 7:32 Monday 30th October, 2006
|
|
|
|
|
|
Hello everyone,
I am working in C#.NET environment.
In project some swf files has been displayed to only logged in users , and this swf files displayed by the coding.
But in testing face my testing team informed me that they are able to access those swf files without logged in. When I asked them about the process. Then they told me that First they read my source code from the browsers view source page. After reading the source they got the full path of swf files.
They simply copy that path and past on to the browser. And really I follow this step and able to see that swf files.
For protect this swf files I gone through all the settings of my site. And remove the read permission to swf files folder. And tested I got success now without logged in users are not able to view those swf files but when user logged into the site and request to view those swf files then that users is not able to view the swf files.
Now please tell me that I can denied those users to see my swf files who are not logged in.
Thanks.
Kunal Sagwaria
|
|
|
|
|
Hello everyone,
I am working in C#.NET environment.
In project some swf files has been displayed to only logged in users , and this swf files displayed by the coding.
But in testing face my testing team informed me that they are able to access those swf files without logged in. When I asked them about the process. Then they told me that First they read my source code from the browsers view source page. After reading the source they got the full path of swf files.
They simply copy that path and past on to the browser. And really I follow this step and able to see that swf files.
For protect this swf files I gone through all the settings of my site. And remove the read permission to swf files folder. And tested I got success now without logged in users are not able to view those swf files but when user logged into the site and request to view those swf files then that users is not able to view the swf files.
Now please tell me that I can denied those users to see my swf files who are not logged in.
Thanks.
Kunal Sagwaria
|
|
|
|
|
Hi,
I have a user control containing a toolstrip. I then want to derive this control. Is it possible to set the toolstrip so that I can modify it's buttons in design time in the derived user control?
Thank you
|
|
|
|
|
Hi,
The whole code works fine.
Except, when i decalared the instance of type ns1 within mystruct, the error "cannot have instance field initializers in structs" is produced. What is the reason benind this? Why we can not create instance fields in structs? while we can do that in classes.
And also, i didn't understand the term "instance field initializers".
public struct mystruct
{
public void display()
{
System.Console.WriteLine("My main Sturct");
}
public struct ns1
{
public void show(int n)
{
System.Console.WriteLine("nested struct 1: Call# " + n);
}
}
<code>
}
its used as follows:
mystruct ms = new mystruct();
ms.display();
mystruct.ns1 a = new mystruct.ns1();
a.show(1);
mystruct.ns1[] b = new mystruct.ns1[2];
b[0].show(2);
b[1].show(3);
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
First of all, the field initializer is the bit that states "= new ns1[2];". This is not allowed because structs are value types.
You could use a constructor though (but not a parameterless constructor - structs don't support them):
public struct mystruct { <br />
public mystruct(int amount)<br />
{<br />
stary = new ns1[amount];<br />
}<br />
public void display() <br />
{<br />
System.Console.WriteLine("My main Sturct"); <br />
} <br />
public struct ns1
{ <br />
public void show(int n) <br />
{ <br />
System.Console.WriteLine("nested struct 1: Call# " + n); <br />
} <br />
}
public ns1[] stary;<br />
}
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Millions of Thanks
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
its all good the only thing that i did not get is the parameter amount from where it gets the value as the declaration
public ns1[] stray
does not sending any value.
|
|
|
|
|
To specify the size, you would use:
mystruct superStruct = new mystruct(10);
This initialise the size of the array to 10. Strictly speaking, this is not good practice because you have put a dependency on the constructor - if you add another constructor, you will need to add this to that constructor as well.
A better approach would be to use a property for the array, and use the following:
public ns1[] MyArray<br />
{<br />
set {<br />
if (stray == null)<br />
stray = new ns1[2];<br />
... any other processing you want to do...<br />
}<br />
}
This clearly shows the benefits of encapsulation, and why it is generally good design practice to declare fields as private, and then use properties to get/set values. (Yes, I know that there are some cases where it makes sense to use public fields but, you should always look to private/protected fields first and then make them public only when you have decided that it makes sense to do so).
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I need to open a File Open Window (browsing a file open dialog) in from my C# ASP .NET code. But I don't know which class/method to use.
Please, could you help me with this problem?
Thanks in advance
|
|
|
|
|
Hi
there is a control in ASP.net -- "FileUpload"
<asp:fileupload id="FileUpload1" runat="server">
May be i m not spaecific too ur requirement
Regards
|
|
|
|
|
<asp:FileUpload ID="FileUpload1" runat="server" />
|
|
|
|
|
use the FileUpload control for browsing a file.
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hi All!
I develop some kind of serial port logger app, and I need to test id witouth the target device. I have sample output in a text file from the device.
How can I do the test?
Sombody know some port emulator, witch read from file, and send tata, or can I do some loopback somehow?
Thanks for help!
|
|
|
|
|
Hi all,
I'm not sure what is wrong with the following code:
ListViewItem _numItem = lvNumberChekker.Items.Add("klkl");
the error underlines the "lvNumberChekker.Items.Add" part and it says: Cannot implicitly convert type 'int' to 'System.Windows.Forms.ListViewItem'
I've done pretty much the same thing on another section and it works fine.
please help
Thank you in advance
Nico
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
I think it should work. Are you sure lvNumberChekker is really a ListView (if its a ListBox the message would make sense)?
Robert
|
|
|
|