PANZER234425
Improving performance / caching
Hello, Im coming to an end with my database software. I filled the database with around 150 rows, but now I got the problem that performance is really trash with everything it does, even if it only does single row querys. So I thought maybe it´s possible to create a cache which stores all data once they are loaded which then is being used by all the other methods making a query.
This is the code where all aircrafts are being collected, at the moment the data is loaded asynchron to not block the UI.
How can I build such a cache with is used by every method?
61 replies
Call method with updated data
Hello, im currently trying to make an update function.
I got 2 lists:
The first list stores every aircraft, while the second one only stores variables that are updatable.
If I exit the form a sql script runs which pulls the updated data in the second list, then It gets updated on the "overview" in a User Control, the user control has a method which calls up a more detailed form where I can update attributes.
Problem: If I open the aircraftDetails (picAircraft_Click) Form the old data is getting showed because the method with the older data is given to it, now I had the idea to compare the two lists and if there is any difference then it should give the updated data and if not it should give the old (currentAircraft).
You guys got any fix for that or an better solution I can use to update the Details form?
12 replies
CS0051: Inconsistent access
Hello, im currently working on an aircraft Database to store all my photos. Today I wanted to implement an USC for all the airlines. Everytime I set create a new airline I want it to create a new USC with a new airline, kinda like pokemom cards, but in the USC class it says following error: CS0051 Inconsistent access: Parameter type "MySQL.AirlineData" is less accessible than method "AirlineField_UC. SetAirlineData(MySQL.AirlineData)"
MySQL.cs (Got all SQL querys)
public class AirlineData
{
public string Name { get; set; }
public string ICAO { get; set; }
public string IATA { get; set; }
public string Callsign { get; set; }
public string Country { get; set; }
public string MainHub { get; set; }
public DateTime Founded { get; set; }
}
public List<AirlineData> getAirlines()
{
List<AirlineData> airlines = new List<AirlineData>();
try
{
string getAirlines = "SELECT * FROM airline;";
MySqlCommand cmdGetAirlines = new MySqlCommand(getAirlines, con);
openConnection();
using (MySqlDataReader reader = cmdGetAirlines.ExecuteReader())
{
while (reader.Read())
{
AirlineData airline = new AirlineData
{
Name = reader.GetString("name"),
ICAO = reader.GetString("icao"),
IATA = reader.GetString("iata"),
Callsign = reader.GetString("callsign"),
Country = reader.GetString("country"),
MainHub = reader.GetString("mainHub"),
Founded = reader.GetDateTime("founded")
};
airlines.Add(airline);
}
}
closeConnection();
}
catch (Exception ex)
{
MessageBox.Show("Error loading airlines: " + ex.Message);
}
return airlines;
}
22 replies
WinForms error after inserting a picture
Hello, I inserted a picture on a button and realized that its way too big scaled, so I deleted and and insertet a new picture with another name. Then I restarted VS22 and get an fatal error saying I cant open the designer. If I put a File with the name of the old file it works fine.
I already deleted the button in the designer and everything related in the code, but I cant fix it
6 replies
GUI programming tool
Hello, im looking for a "drag and drop" GUI Desktop app creator, since windows forms just wont get into my head and the software I want to create unfortunately doesen´t exist and I need it for personal use only.
Are there any good, easier options?
5 replies
Help in coding a Aircraft Database
Hello, since a long time im looking for a software to store all my pictures I made in planespotting. Unfortunately there is no software for my needs, so I tried myself on Windows Forms, I failed, simply cant find a good documentation. I got a bit of C# and Java experience.
Now Im looking for a coding partner which can help me create the software of my needs, so I can learn Windows forms and get a cool software.
Im thankful for every help
11 replies
Currency Calculator
Hello, I got following problem, Im trying to make a small Currency Calculator, you can find my Code in the .txt.
Im currently in the Calculation(string currencyChoice1, string currencyChoice2, double moneyChoice) method, but I dont know how I can efficently get the calculation since there are 10*10 possible calculations, since from USD to EUR or USD to JPY is a different factor. First I thought about a Switch Case, but it cant be right to do a 100 Step big Switch Case.
Im at the beginning of C# learning, would appreciate help
11 replies