AdmiraalSamba
AdmiraalSamba
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
If you want i can send them 🙂
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
hey dont, i got a file with all the requierments of what the projects needs to have.
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
Ooo
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
So what it does?
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
My teacher told me also that i needed to do some stuff on the naming labels and stuff like making code efficient
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
Oke 🙂
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
Just minimum 1 if we don't have any then 0 points on that
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
Yes
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
sort of yes, so our main requirements where have a extern database for full points, intern would be -15 points, a text file would be -25 points no database is 0 points we needed atleast one class
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
for the combo box?
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
the clsBerekeningen is used for multiple calculations and its a requirement to have a class this was my first thought on putting something in a class
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
they are used in different places indeed, just in one form they both used (for the main form where i will have a tabcontrol with the products etc where they can select, edet products but also see their profile)
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
There is
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
clsData*
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
Its both things so i got tblProducts and tblLogin both coming from clsDate
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
geg. is the information class i use to get global variables
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
that's the code i use to update the data
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
public void EditProduct(clsGegevens geg)
{

string queryString = "UPDATE tblProduct SET " +
geg.Productnaam + " = @productNaam, " +
geg.Bereiding + " = @bereiding, " +
geg.Eenheid + " = @eenheid, "+
geg.AantalKoolhydraten + " = @aantalKoolhydraten, "+
geg.AantalCalorieen + " = @aantalCalorieen, "+
geg.Favorieten + " = @favoriet" +
"WHERE" + geg.Productnaam + " = @productNaam";

using (OleDbConnection con = new OleDbConnection(_strConnect))
{
con.Open();
using (OleDbCommand command = new OleDbCommand(queryString, con))
{
command.Parameters.AddWithValue("@productNaam", geg.Productnaam);
command.Parameters.AddWithValue("@bereiding", geg.Bereiding);
command.Parameters.AddWithValue("@eenheid", geg.Eenheid);
command.Parameters.AddWithValue("@aantalKoolhydraten", geg.AantalKoolhydraten);
command.Parameters.AddWithValue("@aantalCalorieen", geg.AantalCalorieen);
command.Parameters.AddWithValue("@favoriet", geg.Favorieten);

command.ExecuteNonQuery();
}
}
}
public void EditProduct(clsGegevens geg)
{

string queryString = "UPDATE tblProduct SET " +
geg.Productnaam + " = @productNaam, " +
geg.Bereiding + " = @bereiding, " +
geg.Eenheid + " = @eenheid, "+
geg.AantalKoolhydraten + " = @aantalKoolhydraten, "+
geg.AantalCalorieen + " = @aantalCalorieen, "+
geg.Favorieten + " = @favoriet" +
"WHERE" + geg.Productnaam + " = @productNaam";

using (OleDbConnection con = new OleDbConnection(_strConnect))
{
con.Open();
using (OleDbCommand command = new OleDbCommand(queryString, con))
{
command.Parameters.AddWithValue("@productNaam", geg.Productnaam);
command.Parameters.AddWithValue("@bereiding", geg.Bereiding);
command.Parameters.AddWithValue("@eenheid", geg.Eenheid);
command.Parameters.AddWithValue("@aantalKoolhydraten", geg.AantalKoolhydraten);
command.Parameters.AddWithValue("@aantalCalorieen", geg.AantalCalorieen);
command.Parameters.AddWithValue("@favoriet", geg.Favorieten);

command.ExecuteNonQuery();
}
}
}
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
and i also wanted to add a query that updates the product from the access database and the code does not work
49 replies
CC#
Created by AdmiraalSamba on 5/17/2023 in #help
❔ Filling a combo box in a class that is from a form
So all of my forms are connected to the clsData (database class) and one of them is connected to clsBerekeningen (aka the class that does the calculations)
49 replies