|
My data is an Access Database file (Databse.mdb), and I can't use registry.
|
|
|
|
|
pricesely you cannot, i think i don't understand your question, do you want all users of your program to access your file or all users of the computer system.
please shed more light so i can help you.
thank you.
|
|
|
|
|
Thanks you for answer
I want all users of the computer system can access my application's file (Create, Edit and delete the application's file). ADMIN users and NON-ADMIN users can edit or delete application's file.
Thanks again
|
|
|
|
|
Hi,
1.
inside CommonApplicationData, you should maintain a folder hierarchy; don't mix files from different applications in a single folder!
2.
I expect CommonApplicationData by default to offer read access only, as it is data that may affect all users.
3.
Hence, if you need shared and modifiable data, use CommonApplicationData, let your installer:
- create an appropriate subfolder, and set its permissions to read-write for all;
- create whatever data files are required.
An installer can do that as it typically is run with administrative privileges, especially since you are installing for the benefit of all users.
|
|
|
|
|
On a file server perhaps?
Maybe write a Web Service?
At least %ALLUSERSPROFILE%\Application Data\your app
|
|
|
|
|
PIEBALDconsult wrote: At least %ALLUSERSPROFILE%\Application Data\your app
No no, one really should use the appropriate method to get there (e.g. Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)) as the folder names may evolve from one Windows edition to the next, and are called differently in different regions. And then they may add Local, Roaming, and other goodies, your app can't possibly keep up with all of that.
|
|
|
|
|
The heck it can't.
Luc Pattyn wrote: evolve from one Windows edition to the next
I'm staying with XP.
|
|
|
|
|
PIEBALDconsult wrote: I'm staying with XP
... but the customer's won't so we're forced to code accordingly
|
|
|
|
|
Customers?
|
|
|
|
|
... that use the applications you write - who are probably using Windows 7. The chances of them still being with XP is slim, and in a year or two virtually nill. So we have no choice but to code for use in the latest OS.
|
|
|
|
|
Plus, how else can I do:
<DBT>
<DatabaseManager Load="%APPDATA%\DatabaseManager.xml" />
</DBT>
|
|
|
|
|
That is better, at least it does not have the "Application Data" literal string.
BTW: you might want to follow the convention of having a company and a product subfolder.
|
|
|
|
|
I hesitate to make a directory (or two) for one measly XML file.
|
|
|
|
|
and that is exactly why the top directory of your C: partition is such a mess
|
|
|
|
|
How'd you guess?
|
|
|
|
|
I wrote this tip[^] to address this point exactly.
|
|
|
|
|
Pls i want to know where is the start point in a class lib project.
what i mean is how do acchieve class initilalize here like is in vb6
thanks and best regards.
|
|
|
|
|
There is no "start point" in a class lib project - it cannot run on it's own. A class lib is a set of classes that can be used by a variety of other applications, they are not executable directly.
Instead, the various class constructors do the init when they are first executed.
If you need a start point, then create it as a Winforms project or similar instead.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
I am not able to connect to a remote MySQL server on C#.Net. The server is not accepting the request of opening the database. I think the connection string is going somewhere wrong:
<add key="ConnectionString" value="SERVER =IP add; HOST=localhost; PORT=portNo; DATABASE=dbname; UID=userId; PASSWORD=pass;Connection Lifetime=0;"/>
I dont know where im going wrong. Please correct me if someone knows the correct string to connect to a MySQL db thru C#.Net2.0
Thanks
|
|
|
|
|
Message Closed
modified 23-Nov-14 5:58am.
|
|
|
|
|
Dear Friend i have tried it earlier, it didn't work out for me ..
|
|
|
|
|
Message Closed
modified 23-Nov-14 5:58am.
|
|
|
|
|
Connection Terminated unexpectedly. I would like to add here that now I have installed a local MySQL Server and restored one of the table to fetch data form it. But still I am not able to connect to the database locally also from C#.Net2.0
When the code reaches to mySQLCon.open(), then it fires the above exception.
Connection String:"Server=localhost; PORT=80; Data Source=ecampust_opensis; User Id=root; Password=;"
Thanks
|
|
|
|
|
Show us the code fragment you are using to access the connection string, and the code fragment you use to open the connection to the DB. (Not the whole program, please, just the relevant bits)
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Web.Config: Containing the connection string
<appSettings><br />
<add key="ConnectionString" value="Server=localhost; PORT=80; Data Source=ecampust_opensis; User Id=root; Password=;"/><br />
</appSettings>
Fetching the Connection string into a string connStr and opening the connection:
connStr = System.Configuration.ConfigurationManager.AppSettings["ConnectionString"];
mySQLCon = new MySqlConnection(connStr);
mySQLCon.Open();
|
|
|
|