|
|
I want to load an Excel file which contains my data, then create pivot table and pivot chart based on that file. Is there any library (free one) that can do this without limitation?
|
|
|
|
|
|
How to change data by using a removable disk in C Sharp language
|
|
|
|
|
You're going to have to be a lot clearer about what your problem is: we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have a database designed in C Sharp, and I have to modify this data via the Internet remotely. I want a way to modify the data by means of a removable disk so that the user takes the disk and inserted it into his device and then the modification is done
|
|
|
|
|
You can't do that automatically anymore - at least not without getting the user to change his settings, and that dangerous: Using AutoPlay and AutoRun in Windows 10 (Article from SamLogic)[^]
It's dangerous because it means any executable disk that's inserted will autorun, and it was disabled because of virus / trojan activity using it. Certainly, I wouldn't enable it on my systems!
So you would have to run an app on the client computer that either processes the data, or which detects a removable disk being inserted - this may help: Detecting USB Drive Removal in a C# Program[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You don't understand what I mean yet
I have a database of 500 employees
And I have another device with the same employee database that I have. I want in the event that I change the employee's data, then transfer the update to the disk and give it to the user to get the update on the data of his employees
|
|
|
|
|
So what part of that do you need help with?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I want to update the data via the removable disk
|
|
|
|
|
And what part of that is proving difficult?
Seriously, I can't read your mind - so repeating the lack of information you didn't give us in the first place doesn't help anybody!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
La base de données est dans mon appareil et je souhaite apporter des modifications au niveau de la base de données client à partir de mon appareil car je suis le seul autorisé à apporter des modifications aux données car je suis l'administrateur
Google Tranlate:
The database is in my device and I want to make changes at the customer database level from my device because I am the only one allowed to make changes to the data because I am the administrator
modified 15-Jan-21 7:32am.
|
|
|
|
|
Veuillez utiliser l'anglais ici. J'ai traduit votre message pour vous cette fois
|
|
|
|
|
For the third time:Quote: And what part of that is proving difficult?
What have you tried?
Where are you stuck?
What help do you need?
I'm not trying to be difficult, but you aren't telling us anything!
Quote: Et quelle partie de cela s'avère difficile?
Qu'avez-vous essayé?
Où es-tu coincé?
Quelle aide avez-vous besoin?
Je n'essaye pas d'être difficile, mais tu ne nous dis rien!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
As OG said this cannot be done automatically. There should be an application that uses the database, you need to write an update process in that application to read the data from the removable drive and update the database.
In other words YOUR USER has to initiate the process somehow and you need to write the process.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I want an example in C Sharp
|
|
|
|
|
You keep saying "I want to update the data via the removable disk" but that doesn't make any sense because the disk itself cannot modify the data as it's not code that runs.
You can store an app on the disk and the user can launch that app, modifying a database that is also stored on that disk, but that's a severe security risk to your database and the people you describe in that database.
What you're doing seems like a really bad idea.
|
|
|
|
|
As the OP allready wrote : he wants to have a sample code.
This answers the unanswered question from Griff too.
The OP has no idea and now he wants to have a (more or less) complete solution.
A long long time ago (long before Networks are usual) I made a similar solution for a friend of mine. Perhapas this is an idea for the OP :
I store each data with a Timestamp, which represents the last modification, on the disk. The storing of the complete data was an action which was selected by the user.
The receiving PC could import the data and replaces each datablock in it's own "collection" with the data from the disk, if it's timestamp is newer.
If the data isn't existing on the PC it was added.
Finally the complete data (with the new timestamp) is written back to the disk so that the 2nd PC could import it. This action was also necessary.
This is the only way (for me) to do something like this if there normally is no connection between both (or more) PC's.
|
|
|
|
|
I'll give you the exact example in C# that you want. My rates are very reasonable.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Exactly the same as if you were using a fixed disk. You need to attach the removable disk, make sure it is writable from your userid, and then just treat it as normal.
|
|
|
|
|
Press eject.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Hi,
I use this class to read XML file and get color information of DataGridView rows.
When I run, compiler says: System.NullReferenceException: 'Object reference not set to an instance of an object.'
My class is:
public static void ReadDataGridViewSettings(System.Windows.Forms.DataGridView dgv)
{
XmlDocument xmldoc = new XmlDocument();
XmlNodeList xmlnode;
FileStream fs = new FileStream(Application.StartupPath + @"\MyGrid.xml", FileMode.Open, FileAccess.Read);
xmldoc.Load(fs);
xmlnode = xmldoc.GetElementsByTagName("Row");
for (int i = 0; i <= dgv.Rows.Count; i++)
{
int cellcolor = int.Parse(xmlnode[i].ChildNodes.Item(0).InnerText.Trim());
int textcolor = int.Parse(xmlnode[i].ChildNodes.Item(1).InnerText.Trim());
if (cellcolor != 0)
{
dgv.Rows[i].DefaultCellStyle.BackColor = Color.FromArgb(Convert.ToInt32(cellcolor));
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.FromArgb(Convert.ToInt32(textcolor));
}
else
{
dgv.Rows[i].DefaultCellStyle.BackColor = Color.White;
dgv.Rows[i].DefaultCellStyle.ForeColor = Color.Black;
}
}
fs.Close();
}
My XML file has this structure:
<dataGridView1>
<Row>
<CellColor>-677434</CellColor>
<TextColor>0</TextColor>
</Row>
<Row>
<CellColor>0</CellColor>
<TextColor>0</TextColor>
</Row>
</dataGridView1>
How can I fix it?
|
|
|
|
|
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.
Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which means that there is no instance of a class in the variable.
It's a bit like a pocket: you have a pocket in your shirt, which you use to hold a pen. If you reach into the pocket and find there isn't a pen there, you can't sign your name on a piece of paper - and you will get very funny looks if you try! The empty pocket is giving you a null value (no pen here!) so you can't do anything that you would normally do once you retrieved your pen. Why is it empty? That's the question - it may be that you forgot to pick up your pen when you left the house this morning, or possibly you left the pen in the pocket of yesterday's shirt when you took it off last night.
We can't tell, because we weren't there, and even more importantly, we can't even see your shirt, much less what is in the pocket!
Back to computers, and you have done the same thing, somehow - and we can't see your code, much less run it and find out what contains null when it shouldn't.
But you can - and Visual Studio will help you here. Run your program in the debugger and when it fails, VS will show you the line it found the problem on. You can then start looking at the various parts of it to see what value is null and start looking back through your code to find out why. So put a breakpoint at the beginning of the method containing the error line, and run your program from the start again. This time, VS will stop before the error, and let you examine what is going on by stepping through the code looking at your values.
But we can't do that - we don't have your code, we don't know how to use it if we did have it, we don't have your data. So try it - and see how much information you can find out!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Alex Dunlop wrote: compiler says: System.NullReferenceException
The compiler doesn't generate that exception; the runtime does.
If it was a compiler error, you wouldn't be able to run your application at all, because you wouldn't be able to compile it.
Alex Dunlop wrote: new FileStream(Application.StartupPath + @"\MyGrid.xml"
You shouldn't try to write files in the same directory as your application. When it's deployed, it will most likely be stored under the "Program Files" directory, and it would need to run as an admin account to have permission to write to its own directory.
See Where Should I Store My Data?[^] for suggestions of more appropriate locations to save your files.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|