Click here to Skip to main content
15,894,410 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: window application deployment Pin
Christian Graus2-Aug-07 0:32
protectorChristian Graus2-Aug-07 0:32 
GeneralRe: window application deployment Pin
Vimalsoft(Pty) Ltd2-Aug-07 4:27
professionalVimalsoft(Pty) Ltd2-Aug-07 4:27 
AnswerRe: window application deployment Pin
Tom Deketelaere1-Aug-07 20:44
professionalTom Deketelaere1-Aug-07 20:44 
Questionminesweeper Pin
gamesiao1-Aug-07 17:56
gamesiao1-Aug-07 17:56 
AnswerRe: minesweeper Pin
Christian Graus1-Aug-07 18:24
protectorChristian Graus1-Aug-07 18:24 
QuestionNamespaces Pin
2hdass1-Aug-07 13:33
2hdass1-Aug-07 13:33 
AnswerRe: Namespaces Pin
Christian Graus1-Aug-07 13:49
protectorChristian Graus1-Aug-07 13:49 
QuestionUsing HasChanges to find unsaved data Pin
steve_rm1-Aug-07 11:58
steve_rm1-Aug-07 11:58 
Hello,

VS 2005 using typed datasets

My customer want to close a form, but before the form closes, they want to be informed of any unsaved changes.

I have list box that is bound to a bindingsource that dislays orders. I also have a bindingsource that is bound to a datagridView. I want to detect changes in these 2 data tables.

I have decided to use MyDataSet.HasChanges(). However, as I have been testing this, i find that it always produces a true, even when I have saved all my data to these 2 tables.
<br />
hasChanges = Me.DsAddComponetAndEquipment.HasChanges()<br />
            If (hasChanges) Then<br />
                'Inform the user of unsaved data<br />
            Else<br />
                'Everthing is saved so close form<br />
            End If<br />


However, if i do the following:
<br />
MydataSet.AcceptChanges()<br />
MyDataSet.HasChanges()<br />

Then it will be false.

In my typed dataset I have all the data tables for my project, about 30. So maybe it is detecting one of them as been changed. However, even when I don't open this forms that use the other data tables, i still get a true everytime I call the HasChanges. I just want to check only the orders and orderDetails table for changes.

Is there another method for doing this.

As an alternative I tried the get changes for the 2 data tables, if they return nothing, then there are no changes
<br />
 dtOrders = Me.MyDataSet.Orders.GetChanges()<br />
 dtOrderDetails = Me.MyDataSet.OrderDetails.GetChanges()<br />


However, the above code resulted in an error "OrderDetailsID doesn't allow NULLs" This was because I added a datarow to the datatable (orderDetails) then called the getChanges. Not sure how to solve the above error.

Many thanks,
AnswerRe: Using HasChanges to find unsaved data Pin
ctlqt121-Aug-07 18:46
ctlqt121-Aug-07 18:46 
Questionstart and stop timer Pin
Cory Kimble1-Aug-07 10:57
Cory Kimble1-Aug-07 10:57 
AnswerRe: start and stop timer Pin
Johan Hakkesteegt1-Aug-07 20:16
Johan Hakkesteegt1-Aug-07 20:16 
GeneralRe: start and stop timer Pin
Cory Kimble2-Aug-07 3:02
Cory Kimble2-Aug-07 3:02 
GeneralRe: start and stop timer Pin
Johan Hakkesteegt2-Aug-07 23:16
Johan Hakkesteegt2-Aug-07 23:16 
AnswerRe: start and stop timer Pin
Cory Kimble3-Aug-07 2:06
Cory Kimble3-Aug-07 2:06 
QuestionCustom event on variable change Pin
2hdass1-Aug-07 7:58
2hdass1-Aug-07 7:58 
AnswerRe: Custom event on variable change Pin
Colin Angus Mackay1-Aug-07 8:22
Colin Angus Mackay1-Aug-07 8:22 
GeneralRe: Custom event on variable change Pin
2hdass1-Aug-07 9:17
2hdass1-Aug-07 9:17 
Questionsend data from a listbox to textbox Pin
sixecho1-Aug-07 6:14
sixecho1-Aug-07 6:14 
AnswerRe: send data from a listbox to textbox Pin
Colin Angus Mackay1-Aug-07 8:18
Colin Angus Mackay1-Aug-07 8:18 
GeneralRe: send data from a listbox to textbox Pin
sixecho1-Aug-07 9:19
sixecho1-Aug-07 9:19 
GeneralRe: send data from a listbox to textbox Pin
Colin Angus Mackay1-Aug-07 10:11
Colin Angus Mackay1-Aug-07 10:11 
GeneralRe: send data from a listbox to textbox Pin
Colin Angus Mackay2-Aug-07 7:51
Colin Angus Mackay2-Aug-07 7:51 
QuestionChanging button border Pin
HelpMePlease!1-Aug-07 5:40
HelpMePlease!1-Aug-07 5:40 
AnswerRe: Changing button border Pin
Taylor Kobani1-Aug-07 10:20
Taylor Kobani1-Aug-07 10:20 
GeneralRe: Changing button border Pin
HelpMePlease!1-Aug-07 12:43
HelpMePlease!1-Aug-07 12:43 

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.