Click here to Skip to main content
15,915,336 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHierarchical data Pin
advansis4-Jun-07 6:25
advansis4-Jun-07 6:25 
AnswerRe: Hierarchical data Pin
Dave Kreskowiak4-Jun-07 6:44
mveDave Kreskowiak4-Jun-07 6:44 
QuestionHow to unzip a pkzip file with sharpziplib? Pin
JSThomas4-Jun-07 6:24
JSThomas4-Jun-07 6:24 
QuestionEdit menu item Pin
jds12074-Jun-07 5:04
jds12074-Jun-07 5:04 
AnswerRe: Edit menu item Pin
jwlc764-Jun-07 5:40
jwlc764-Jun-07 5:40 
QuestionVB.Net Pin
SekharOne4-Jun-07 4:31
SekharOne4-Jun-07 4:31 
AnswerRe: VB.Net Pin
leckey4-Jun-07 5:27
leckey4-Jun-07 5:27 
QuestionError updating Dataset to Reflect into the Original Table Pin
Vimalsoft(Pty) Ltd4-Jun-07 4:13
professionalVimalsoft(Pty) Ltd4-Jun-07 4:13 
hi my name is Vuyiswa, i have the Following Problem
.
am using vb.net in vs2003. i have written an dabase application.i have knowledge of ADo.net and i have created my connection and droped the table on my form and generated the dataset. now when i add the new row to the dataset, it complete the process and be succsessfull, here is the code
<br />
'save the New Record for an Add or Edit<br />
        If mblnAdding Then<br />
            Try<br />
                Dim newRow As DataRow = DataSet11._PROPERTY.NewRow<br />
                newRow("Num_key") = txtnumkey.Text<br />
                newRow("Extension") = txtextension.Text<br />
                newRow("Cell_ID") = txtcellid.Text<br />
                newRow("ACTUAL_EXTENT") = txtactualextent1.Text<br />
                newRow("Lis_key") = txtliskey.Text<br />
                newRow("Func_key") = txtfunckey.Text<br />
                newRow("PROP_CATEGORY_ID") = txtcategoryid.Text<br />
                newRow("Geocode") = txtgeocode.Text<br />
                DataSet11._PROPERTY.Rows.Add(newRow)<br />
<br />
            Catch exc As Exception<br />
                MessageBox.Show("Unable to add the Record." & _<br />
                ControlChars.NewLine & exc.Message, "Property")<br />
<br />
            End Try<br />
            mblnAdding = False<br />
            lblRecordNumber.Text = "Record Added at the end of the Table"<br />
        End If<br />
        Locktextboxes()<br />
        EnableNavigation()<br />
        cmdsave.Enabled = False<br />
        cmdadd.Text = "&Add"<br />
        mblnIsDirty = True<br />
    End Sub<br />


and my code is Very well working, i used the Closing Event of the form to update, meaning to save the dataset into the real table so as to reflect the new added row into my table, so i put the Following Code on the closing Event of my form
<br />
Private Sub frmSingle_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing<br />
        'save the datasource Changes<br />
        If mblnIsDirty Then<br />
            If MessageBox.Show("Do you want to Save the Changes?", "Property", _<br />
            MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes Then<br />
                Try<br />
                    SqlDataAdapter1.Update(DataSet11, "Property")<br />
                    Me.SqlDataAdapter1.Update(Me.DataSet11, "PROPERTY")<br />
<br />
                Catch<br />
                    MessageBox.Show("Error saving the File", "Property")<br />
                End Try<br />
            End If<br />
        End If<br />
    End Sub<br />

Built it and run it ,after i click on the save Button of the first code, it save a new Row in the dataset. now when i try to close the form, it recognises the changes in the dataset and ask me if ai want to save the changes and i say "Yes" and it gives me the Error that used to trap Errors. as you have seen my above Errors, please help me and tell me what is wrong, why doesnt it update my dataset by appending a Row in the tables.

?

Vuyiswa

AnswerRe: Error updating Dataset to Reflect into the Original Table Pin
Dave Kreskowiak4-Jun-07 6:35
mveDave Kreskowiak4-Jun-07 6:35 
GeneralRe: Error updating Dataset to Reflect into the Original Table Pin
Vimalsoft(Pty) Ltd4-Jun-07 21:12
professionalVimalsoft(Pty) Ltd4-Jun-07 21:12 
GeneralRe: Error updating Dataset to Reflect into the Original Table Pin
Dave Kreskowiak6-Jun-07 16:30
mveDave Kreskowiak6-Jun-07 16:30 
QuestionProgress indicator Pin
DanB19834-Jun-07 3:56
DanB19834-Jun-07 3:56 
AnswerRe: Progress indicator Pin
Dave Kreskowiak4-Jun-07 6:38
mveDave Kreskowiak4-Jun-07 6:38 
AnswerRe: Progress indicator Pin
Thomas Stockwell4-Jun-07 8:22
professionalThomas Stockwell4-Jun-07 8:22 
QuestionVBA Excel Help Pin
Duane in Japan4-Jun-07 3:50
Duane in Japan4-Jun-07 3:50 
QuestionAfter sorting in a DataGridView the Row.EndEdit causes row change Pin
Marcus J. Smith4-Jun-07 2:36
professionalMarcus J. Smith4-Jun-07 2:36 
AnswerRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Dave Kreskowiak4-Jun-07 9:01
mveDave Kreskowiak4-Jun-07 9:01 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Marcus J. Smith4-Jun-07 9:17
professionalMarcus J. Smith4-Jun-07 9:17 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Dave Kreskowiak4-Jun-07 10:24
mveDave Kreskowiak4-Jun-07 10:24 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Marcus J. Smith4-Jun-07 10:56
professionalMarcus J. Smith4-Jun-07 10:56 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Dave Kreskowiak4-Jun-07 13:38
mveDave Kreskowiak4-Jun-07 13:38 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Marcus J. Smith5-Jun-07 2:26
professionalMarcus J. Smith5-Jun-07 2:26 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Marcus J. Smith5-Jun-07 8:09
professionalMarcus J. Smith5-Jun-07 8:09 
GeneralRe: After sorting in a DataGridView the Row.EndEdit causes row change Pin
Dave Kreskowiak6-Jun-07 16:36
mveDave Kreskowiak6-Jun-07 16:36 
QuestionDataSet writing errors with code Pin
Quecumber2564-Jun-07 2:26
Quecumber2564-Jun-07 2:26 

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.