Click here to Skip to main content
16,006,749 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: windows service, event log message file Pin
jkirkerx9-Oct-14 10:24
professionaljkirkerx9-Oct-14 10:24 
GeneralRe: windows service, event log message file Pin
Eddy Vluggen9-Oct-14 10:31
professionalEddy Vluggen9-Oct-14 10:31 
GeneralRe: windows service, event log message file Pin
Eddy Vluggen10-Oct-14 8:12
professionalEddy Vluggen10-Oct-14 8:12 
AnswerRe: windows service, event log message file Pin
Richard Deeming9-Oct-14 22:47
mveRichard Deeming9-Oct-14 22:47 
GeneralRe: windows service, event log message file Pin
jkirkerx10-Oct-14 7:10
professionaljkirkerx10-Oct-14 7:10 
AnswerRe: windows service, event log message file, the mc file [SOLVED] Pin
jkirkerx14-Oct-14 10:56
professionaljkirkerx14-Oct-14 10:56 
QuestionHow to search and show with Text Box from Access Database in VB.Net 2010? Pin
Kelven DeJaVu8-Oct-14 16:14
Kelven DeJaVu8-Oct-14 16:14 
AnswerRe: How to search and show with Text Box from Access Database in VB.Net 2010? Pin
Richard MacCutchan8-Oct-14 21:45
mveRichard MacCutchan8-Oct-14 21:45 
AnswerRe: How to search and show with Text Box from Access Database in VB.Net 2010? Pin
Maciej Los9-Oct-14 11:10
mveMaciej Los9-Oct-14 11:10 
AnswerRe: How to search and show with Text Box from Access Database in VB.Net 2010? Pin
Otekpo Emmanuel9-Oct-14 14:16
Otekpo Emmanuel9-Oct-14 14:16 
GeneralRe: How to search and show with Text Box from Access Database in VB.Net 2010? Pin
Kelven DeJaVu11-Oct-14 6:08
Kelven DeJaVu11-Oct-14 6:08 
QuestionDataAnnotations - Multiple Acceptable Values Pin
Dominick Marciano8-Oct-14 7:32
professionalDominick Marciano8-Oct-14 7:32 
AnswerRe: DataAnnotations - Multiple Acceptable Values Pin
Richard Deeming9-Oct-14 22:45
mveRichard Deeming9-Oct-14 22:45 
GeneralDroptiles Pin
KokDavy8-Oct-14 4:58
KokDavy8-Oct-14 4:58 
GeneralRe: Droptiles Pin
Tim Carmichael8-Oct-14 7:27
Tim Carmichael8-Oct-14 7:27 
QuestionCompare tables and show the difference Pin
byka8-Oct-14 2:35
byka8-Oct-14 2:35 
AnswerRe: Compare tables and show the difference Pin
Praneet Nadkar8-Oct-14 2:51
Praneet Nadkar8-Oct-14 2:51 
GeneralRe: Compare tables and show the difference Pin
byka8-Oct-14 3:08
byka8-Oct-14 3:08 
GeneralHighchart server side settings and update Pin
KokDavy6-Oct-14 13:09
KokDavy6-Oct-14 13:09 
GeneralRe: Highchart server side settings and update Pin
Dave Kreskowiak6-Oct-14 17:43
mveDave Kreskowiak6-Oct-14 17:43 
QuestionThe state value of an object ? Pin
dilkonika4-Oct-14 16:52
dilkonika4-Oct-14 16:52 
AnswerRe: The state value of an object ? Pin
Dave Kreskowiak4-Oct-14 18:53
mveDave Kreskowiak4-Oct-14 18:53 
GeneralRe: The state value of an object ? Pin
dilkonika5-Oct-14 3:39
dilkonika5-Oct-14 3:39 
GeneralRe: The state value of an object ? Pin
Dave Kreskowiak5-Oct-14 5:00
mveDave Kreskowiak5-Oct-14 5:00 
QuestionAdding records and save changes simultaneosly for 2 tables Pin
dilkonika3-Oct-14 11:04
dilkonika3-Oct-14 11:04 
Hello !

I have a project in vb.net 2013 , Entity Framework 6 and SQL server 2008R2.

I have this situation :

In database I have 2 tables :

Table 1 : ID (aUTONUMBER, primary kEY) , Name , vl1

Table 2 : ID (AUTONUMBER , primary KEY) , name , value , Table1_id (Foreign key related with ID field in Table1).

In my Form :

I HAVE 2 BINDINGSOURCES : Table1BindingSource and Table2Bindingsource.

I have 3 buttons : New1 - that add new record in Table1BindingSource , New2 - that add a new record in Table2BindingSource , SAVE - tHAT SAVE ALL to database.

I HAVE PROBLEMS IN THIS CASE :

I ADD A NEW RECORD IN Table1BindingSource . After I Add new record to Table2Bindingsource ( but since the id field in Table1Bindingsource is not set yet, I set the Table1_id=0 for this new record ).

After I press the Save button that has this code :

--------------------------------------------------

Table2bindingsource.SuspendBinding()

context.savechanges()

For each itm in table2bindingsource

itm.Table1_id=Table1bindingsource.current.id

Next

Table2bindingsource.ResumeBinding()

context.savechanges()

-----------------------------------------------------

But after this , in database I have 1 record in Table1 , but on Table2 I have no records.

What can I do , because I need that users can add records to both bindingsources and after to press the save button ?

Thank you !

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.