|
I put "C# custom explorer sample project" into Google and found this:
http://www.codeproject.com/useritems/ExplorerTree.asp[^]
Usually when you do your Google queries for this kind of thing, if you put the language or technology you want to use, it will come back with pretty good responses. This was the third result, and I think it should answer your question.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
Here's another one: C# File Browser[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi sir,
I wrote a app.config as follows
<appsettings>
<add name="dbConnection"
="" connectionstring="data source=MANGALA;initial catalog=Northwind;persist security info=False;user id=sa;pwd=sa;workstation id=MANGALA;packet size=4096" providername="System.Data.SqlClient">
I called that connection string like this,
SqlConnection cn;
sConn = System.Configuration.ConfigurationManager.AppSettings("dbconnection");
cn = new SqlConnection(sConn);
cn.Open();
then it is an error :
The type or namespace name 'ConfigurationManager' does not exist in the class or namespace 'System.Configuration' (are you missing an assembly reference?)
I am a beginner for c# can you help me?
thank you
|
|
|
|
|
Collapse your project in the Solution Explorer window and right click 'References' and choose 'Add Reference'.
A popup window appears, on the .NET tab, choose System.Configuration and press the OK button.
Try rebuilding your project
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Hi
I tried that, but there is no just System.Configuration. it has System.Configuration.install.dll I add that. but same error is coming.
thanks
|
|
|
|
|
That means you already added it, and you just need the Using statement I mentioned.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
mwith wrote: Hi sirs and madams,
(fixed that for ya)
You need to have:
using System.Configuration;
at the top of your code file. You might also need to explicitly add the reference to the System.Configuration assembly to your project. (Right-click on 'References' in the solution explorer, and click 'Add Reference...', then select the System.Configuration assembly, which is under the .Net tab in the window that pops up, and add that assembly to your project.)
You will need to add a name attribute to your config file entry, or the app can't tell what you mean by 'dbconnection'. I do it like this:
<appSettings>
<add key="dbconnection" value="myconnectionstringwhateveritis"/>
</appSettings>
Also, I hope you didn't just give us all your SA login info. You need to change that right away if you did.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
With a password like that he'd want to change it even if he hadn't posted it on the internet. I'm assuming that he's changed it to sa like i would change mine to pwd if posting stuff on a forum.
Reminds me of a place i worked where the head of IT was one of the owners of the company. While searching for some info about recordsets on usenet i saw a post of his from 5 years before. I duly went to have a look and found a username and password URL and port in his example code. I then discovered that not only had he not changed the password for this account but it was on a server that was still exposed to the internet and had domain admin permissions on our internal network. When i asked him about it, he said "That account, oh we haven't used it for ages, why do you ask".
sorry for the OT,
Russ
|
|
|
|
|
That's not really true, it would be neat though, but as you can see in his code, het uses the entire namespace in his code :
System.Configuration.ConfigurationManager.AppSettings["name"]
which does not require a 'using' statement, but again... it would be neat...
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Yeah you're right... I totally missed that.
I think he's using .Net 1.1, but I can't remember what the difference was. With a .Net 2.0 project, it should be working if the assembly is added like he said.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
Erhm, you don't have the configurationmanager object there...
The .NET 1.1 ols fashion way is
System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]
(or ofcourse)
using System.Configuration;
and
ConfigurationSettings.AppSettings["ConnectionString"]
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
What version of visual studio / .NET Framework are you using. The code you have will only work in .NET 2.0 (Visual Studio 2005).
Also, replace the () with [] after AppSettings because once you've fixed this error your going to get another.
|
|
|
|
|
|
(I was typing my reply when your old post disappeared! I figured it had been moved, but I had some trouble finding it. Anyway, here's what I was trying to say before.)
You're thinking a little old-skool there. I think if you take advantage of the .Net Framework, you can eliminate the middle-tier and still keep things secure. You don't want to get into COM-hell, which is not entirely eliminated with .Net assemblies. The Windows client and the SQL database are enough. Keep it simple. If you are going to store your information in a database, you won't need to serialise your objects... that's really only useful if you're using files for storage or if you really need a middle-tier. To store an object all you need is to put the current values of the member variables into columns in your database. So if you had an object like this:
class myObject {
int myNumber;
string myString;
...some functions and such...
}
You would simply create a database table like this:
create table myObject (
object_id int,
myNumber int,
myString varchar(x)
)
You need an object ID so you can make sure you don't get multiple instances mixed up. You could use any property of the object to make it unique - doesn't have to be an integer.
Then you create a stored procedure to store this object data (and perhaps send back a new unique ID), and another stored procedure to retrieve objects based on their ID. You will be able to use these stored procedures in a secure fashion from the client, and you will be able to take advantage of all kinds of cool security features designed for this exact purpose, and all your validation can be performed on either of (or both of) the two layers. As long as you're not doing super-complex math or predicting the weather or something, you should be able to push all the validation down to the database layer. That is the way to go if you suspect multiple versions of the client, but if you have total control over client updates, then you are safe doing that stuff on the client and avoiding a round trip to some server somewhere. I've just finished a very complex application that uses this model - there was no reason for a middle tier. You haven't given any reason why you really need that.
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
|
That makes sense. Are you using some kind of off-the-shelf user interface? I'm curious as to why you don't build that yourself. IMO, the best thin client is a web browser. You have full control over the versioning of the software that way, because when you change the web site, it changes for everyone at the same time. In that case, you do have a middle tier, sort of. You have the thin client (browser), the middle tier is the web server with the ASP(x) engine, and then of course the back-end database.
Occasionally, it's not worth it to dumb-down your software to work on old machine, and more cost-effective to upgrade the office machines. It all depends on the size of the company and how many machines would have to be replaced in order to bring it into the modern world. Companies need to keep their office equipment up to date, and a lot of times, deprecated software can help 'motivate' that change. If that makes sense...
"Quality Software since 1983!" http://www.smoothjazzy.com/ - see the "Programming" section for (freeware) JazzySiteMaps, a simple application to generate .Net and Google-style sitemaps!
|
|
|
|
|
Hi,
Can anyone help me how to create three floats in dev express mask editor.
Eg
-12.00,12,1
|
|
|
|
|
Can ny one tell the method how to get a unused port number so that a server can listen on that port.
|
|
|
|
|
u can download Active Ports[^] to see which of the ports are being used.
Regards
Shajeel
|
|
|
|
|
Hi,
How to compare the values of 2 datepickers?
How to validate the columns of a datagrid like the coulmns should accept only the numeric values?
Thank you,
Regards,
Deepa.
|
|
|
|
|
Hi ,
I need to redirect the contents of the command to a file. I tried doing this using follwing peice of code but it doesnt seem to be working.
System.Diagnostics.Process QueryProcess = new System.Diagnostics.Process();
String command = @"ipconfig/all";
QueryProcess.StartInfo.FileName = command;
QueryProcess.StartInfo.Arguments = " >c:\\a.txt";
QueryProcess.Start();
QueryProcess.Close();
Kindly look into the problemand tell me the solution ASAP.
Thanks and Regards,
Sankalp Verma
|
|
|
|
|
pls help..
what can i do if i wish to load the xml onto my grid view using java script without going back to the server.
thank you
|
|
|
|
|
You try AJAX...
Please refer www.w3schools.com for more reference.
|
|
|
|
|
I saved the windowstate of the other application, such as a folder.
when I reopen it, I use the following code:
////////////////////////////////////////////////////////////////////
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartArgument = "c:"
p.Start();
Application.DoEvents();
SetWindowPos(new HandleRef(null, p.MainWindowHandle), new HandleRef(null, IntPtr.Zero), 10, 10, 0, 0, 0x15);
//////////////////////////////////////////////////////////////////////
but when it run to "Application.DoEvents();", the p exited, then p cann't get MainWindowHandle.
so the method failed.
any other method?
|
|
|
|
|
Meybe create a new process object and attach it to your running process, and then 'do your thing'
|
|
|
|