verwendetes Datenbanksystem: Linq
Hallo!
Ich bin gerade dabei mir Linq azueignen. Nun habe ich aber ein Problem.
Bei dem folgenden Code wird nichts in der Datenbank angelegt.
var db = new KundenDataContext();
var customers = db.GetTable<KONTAKTE>();
var customer = new KONTAKTE();
customer.KID = fCustomerID;
customer.NAME = edShort.Text;
customer.VORNAME = edFirstname.Text;
customer.SALUTATION = cbbSalution.SelectedIndex;
customer.STANDARDFORMAILINGS = 0;
customer.ZUSATZ = "";
customer.EXHEBITION = 0;
if (edPhone.Text != "")
{
customer.KONTAKTE_DETAILs.Add(new KONTAKTE_DETAIL()
{
KID = customer.ID,
VALUE = edPhone.Text,
FIELDTYP = (int)AdrTypes.FieldType.Tel
});
}
if (edMobile.Text != "")
{
customer.KONTAKTE_DETAILs.Add(new KONTAKTE_DETAIL()
{
KID = customer.ID,
VALUE = edMobile.Text,
FIELDTYP = (int)AdrTypes.FieldType.Mobil
});
}
if (edFax.Text != "")
{
customer.KONTAKTE_DETAILs.Add(new KONTAKTE_DETAIL()
{
KID = customer.ID,
VALUE = edFax.Text,
FIELDTYP = (int)AdrTypes.FieldType.Fax
});
}
customers.InsertOnSubmit(customer);
db.SubmitChanges();
Edit: Problem gelöst!!!
Gruß!
Edit: Problem gelöst!!!
Gruß!
wäre nett, wenn du auch noch die Lösung postest ?!