Click here to Skip to main content
15,893,487 members
Home / Discussions / C#
   

C#

 
AnswerRe: Playing scenarios in media player control Pin
Christian Graus4-Oct-09 20:42
protectorChristian Graus4-Oct-09 20:42 
AnswerRe: Playing scenarios in media player control Pin
N a v a n e e t h4-Oct-09 20:43
N a v a n e e t h4-Oct-09 20:43 
GeneralRe: Playing scenarios in media player control Pin
Christian Graus4-Oct-09 20:46
protectorChristian Graus4-Oct-09 20:46 
GeneralRe: Playing scenarios in media player control Pin
N a v a n e e t h4-Oct-09 20:51
N a v a n e e t h4-Oct-09 20:51 
GeneralRe: Playing scenarios in media player control Pin
Christian Graus4-Oct-09 21:09
protectorChristian Graus4-Oct-09 21:09 
QuestionCustom monthCalendar control Pin
d.project4-Oct-09 13:07
d.project4-Oct-09 13:07 
AnswerRe: Custom monthCalendar control Pin
Nisha Agrawal4-Oct-09 20:08
Nisha Agrawal4-Oct-09 20:08 
QuestionProblem with Hierarchical Update with entity framework Pin
hdv2124-Oct-09 12:09
hdv2124-Oct-09 12:09 
Hi i've created a sample application with these characteristics :

1. I have 2 tables (Customers & Orders) in sql server database, Customers is master table and Orders is child table.
2. I have 3 forms in my app,
a. MainForm which display all customers
b. FrmCustomer which use to add new customer or edit current customer, it also display all orders of current customer.
c. FrmOrder which use to add new order or edit current order.

i want give ability to end-user to add new customer and his orders at the same time and click Ok, then my objectContext save all changes to back-end database. for example when i add new customer, FrmCustomer display me to enter new customer info, also i add some orders to his orders list, when i click OK in FrmCustomer, it should save customer and all orders Hierarchically, but it only save customer to database and not orders! can anybody help me to solve this problem ?

here is my code in MainForm to add new customer :


Customer newCust = (Customer)this.bindingSource1.AddNew();
FrmCustomer frm = new FrmCustomer(newCust,this.db);
if (frm.ShowDialog() == DialogResult.OK)
{
            this.bindingSource1.Add(newCust);
            db.SaveChanges(true);
}
else
{
            this.bindingSource1.CancelEdit();                
}


and here is my code in FrmCustomer to add new order :

Order newOrd = (Order)this.bindingSource1.AddNew();
            FrmOrder frm = new FrmOrder(newOrd, this._objContext);
if (frm.ShowDialog() == DialogResult.OK)
{                
                 this.bindingSource1.EndEdit();
}
else
{
                this.bindingSource1.CancelEdit();                
}


Note : db object is my global objectContext to pass to my form's constructor.

thanks in advance.
AnswerRe: Problem with Hierarchical Update with entity framework Pin
Mycroft Holmes4-Oct-09 15:14
professionalMycroft Holmes4-Oct-09 15:14 
Questionhow to block pc on network from another pc Pin
musicogui4-Oct-09 11:50
musicogui4-Oct-09 11:50 
AnswerRe: how to block pc on network from another pc Pin
Christian Graus4-Oct-09 12:03
protectorChristian Graus4-Oct-09 12:03 
AnswerRe: how to block pc on network from another pc Pin
Pete O'Hanlon4-Oct-09 12:04
mvePete O'Hanlon4-Oct-09 12:04 
JokeRe: how to block pc on network from another pc Pin
nagendrathecoder4-Oct-09 19:12
nagendrathecoder4-Oct-09 19:12 
GeneralRe: how to block pc on network from another pc Pin
Pete O'Hanlon4-Oct-09 21:51
mvePete O'Hanlon4-Oct-09 21:51 
GeneralRe: how to block pc on network from another pc Pin
nagendrathecoder4-Oct-09 21:59
nagendrathecoder4-Oct-09 21:59 
Questionprotect connection string c# Form to remote sql server 2008 Pin
mutafa814-Oct-09 7:37
mutafa814-Oct-09 7:37 
AnswerRe: protect connection string c# Form to remote sql server 2008 Pin
Dave Kreskowiak4-Oct-09 8:04
mveDave Kreskowiak4-Oct-09 8:04 
AnswerRe: protect connection string c# Form to remote sql server 2008 Pin
harold aptroot4-Oct-09 9:02
harold aptroot4-Oct-09 9:02 
Questionpossibility of the encapsulation Pin
akram30024-Oct-09 4:08
akram30024-Oct-09 4:08 
AnswerRe: possibility of the encapsulation Pin
Nagy Vilmos4-Oct-09 4:32
professionalNagy Vilmos4-Oct-09 4:32 
GeneralRe: possibility of the encapsulation Pin
akram30024-Oct-09 4:39
akram30024-Oct-09 4:39 
GeneralRe: possibility of the encapsulation Pin
Thaer Hamael4-Oct-09 4:39
Thaer Hamael4-Oct-09 4:39 
GeneralRe: possibility of the encapsulation Pin
Richard MacCutchan4-Oct-09 4:43
mveRichard MacCutchan4-Oct-09 4:43 
GeneralRe: possibility of the encapsulation Pin
Nagy Vilmos4-Oct-09 4:52
professionalNagy Vilmos4-Oct-09 4:52 
QuestionDoes dotnet provide video converter APIs??? Pin
yogesh_softworld1234-Oct-09 1:06
yogesh_softworld1234-Oct-09 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.