i like to make my database insert more dynamicly with functions.
Like this:
private void setValues() {
string test = "foo";
string test2 = "bar";
}
private void WriteToDB() {
dc dcOfMyDatabase = new dc();
DBTable myTable = DbTable() {
field1 = test; // values of other function
field2 = test2; // values of other function
}
}
private void doAll() {
setValues();
WriteToDB();
}
Of Course i can do it with parameters in WriteToDB()... But I have so many fields and hope it works with another clean way.
Im sure there is one correct way for a clean developping something like this.
Thanks and regards.