Hello
I have problem with Windows Azure SQL Database. I connected my application with the cloud database successfully. I made successfully inserts, deletes, updates. Now my problem is i have three tables for example: subjects, professors, subject_professor.
Subjects = {id_subject}
Professors = {id_professor}
subject_professor = {id_subject, id_professor} - which are foreign keys of the two tables above
In c#/xaml windows phone 8 i created the three tables but now when i want to add item in the subject_professor table i got an error. I tried to take the ID from one table and put it in variable but after Azure changed the primary key to be String instead
of int i don't know anymore how to put in var.
Here is another example:
Subjects newSub = new Subjects();
var ID = newSub.id; -----> here is the problem cos ID is no longer int
newSub.Name = "Mathematics" ----> thats working (the ID is created automatically when i create new object )
await subs.InsertAsync(newSub);
Professors newProf = new Professors();
var ID2 = newProf.id
newProf.Name = "Test";
await pro.InsertAsync(newProf);
subject_professor another = new subject(professor) ---> which professor teaches what subject
another.id_subject = ID;
another.id_professor = ID2;
Here i got problem and it says that ID cant reference to null value.
Please i need help with this problem Thank you.