Click here to Skip to main content
15,886,919 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Problem while accessing values set in another class function. Pin
Nilesh Hamane14-Apr-09 22:33
Nilesh Hamane14-Apr-09 22:33 
QuestionTransfer of parametres from Internet Explorer in UseControl ActiveX a component Pin
Degun14-Apr-09 0:49
Degun14-Apr-09 0:49 
AnswerRe: Transfer of parametres from Internet Explorer in UseControl ActiveX a component Pin
dojohansen14-Apr-09 7:33
dojohansen14-Apr-09 7:33 
GeneralRe: Transfer of parametres from Internet Explorer in UseControl ActiveX a component Pin
Degun14-Apr-09 19:58
Degun14-Apr-09 19:58 
GeneralRe: Transfer of parametres from Internet Explorer in UseControl ActiveX a component Pin
dojohansen14-Apr-09 21:03
dojohansen14-Apr-09 21:03 
QuestionDetect save from a VS2005 add-in Pin
Christian Wikander13-Apr-09 22:36
Christian Wikander13-Apr-09 22:36 
AnswerRe: Detect save from a VS2005 add-in Pin
dojohansen14-Apr-09 7:36
dojohansen14-Apr-09 7:36 
QuestionHelp with update Pin
hendrikbez13-Apr-09 19:20
hendrikbez13-Apr-09 19:20 
I am not getting my program to update my access 2003 database. What the hek am I doing wrong.

This is the only problem that I still have in my program

Here is my code (function)
Public Function Edit() As String
       Try

           Dim OleDbConn As OleDbConnection = New OleDbConnection(ConnString)
           OleDbConn.Open()

           Dim MyOledbCommand As OleDbCommand = New OleDbCommand()

           Dim String1, String2, String3, String4, String5, string6, string7, string8, string9, string10, string11, string12, string13 As String

           String1 = TxtLuidraad.Text
           String2 = txtA1.Text()
           String3 = txtA2.Text()
           String4 = txtA3.Text()
           String5 = txtA4.Text()
           string6 = txtA5.Text()
           string7 = txtA6.Text()
           string8 = txtA7.Text()
           string9 = txtA8.Text()
           string10 = txtA9.Text()
           string11 = txtA10.Text()
           string12 = txtA11.Text()
           string13 = txtA12.Text()

           MyOledbCommand.CommandText = "UPDATE Tblokkies SET WHERE leidraad = ?, A1 = ?, A2 = ?, A3 = ?,A4 = ?, A5 = ?, A6 = ?, A7 = ?, A8 = ?, A9 = ?, A10 = ?, A11 = ?, A12 = ?"

           MyOledbCommand.Parameters.AddWithValue("@string1", Me.TxtLuidraad.Text)
           MyOledbCommand.Parameters.AddWithValue("@string2", Me.txtA1.Text)
           MyOledbCommand.Parameters.AddWithValue("@string3", Me.txtA2.Text)
           MyOledbCommand.Parameters.AddWithValue("@string4", Me.txtA3.Text)
           MyOledbCommand.Parameters.AddWithValue("@string5", Me.txtA4.Text)
           MyOledbCommand.Parameters.AddWithValue("@string6", Me.txtA5.Text)
           MyOledbCommand.Parameters.AddWithValue("@string7", Me.txtA6.Text)
           MyOledbCommand.Parameters.AddWithValue("@string8", Me.txtA7.Text)
           MyOledbCommand.Parameters.AddWithValue("@string9", Me.txtA8.Text)
           MyOledbCommand.Parameters.AddWithValue("@string10", Me.txtA9.Text)
           MyOledbCommand.Parameters.AddWithValue("@string11", Me.txtA10.Text)
           MyOledbCommand.Parameters.AddWithValue("@string12", Me.txtA11.Text)
           MyOledbCommand.Parameters.AddWithValue("@string13", Me.txtA12.Text)


           MyOledbCommand.Connection = OleDbConn

           MyOledbCommand.ExecuteNonQuery()
           OleDbConn.Close()

           DisableTextboxes()
           NeroBar1.Value = 0

           FillDataGrid("Select * from Tblokkies")
           FillListBox("Select * from Tblokkies")

           btnaddNew.Enabled = True
           btnDelete.Enabled = True
           ' btnupdate.Enabled = True

           SaveOrEdit = "Cancel"

           'StatusLabel.Text = " Inligtin Verander."
           StatusLabel.Text = "Leidraad   :" & TxtLuidraad.Text & ": Verander."

       Catch err As System.Exception
           StatusLabel.Text = err.Message
       End Try


   End Function


My update button

Private Sub btnupdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnupdate.Click

        StatusLabel.Text = " Kies Leidraad om te verander"

        If ListBox1.SelectedIndex <> -1 Then

            SaveOrEdit = "Edit"
        Else
            StatusLabel.Text = " Bestaande leidraad is nie verander nie"
        End If

            End Sub


My save button

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

       If SaveOrEdit = "Save" Then

           Dim add As DialogResult

           add = Cls_MessageBbox.Show("Is jy Seker jy will Leidraad" & Environment.NewLine & TxtLuidraad.Text & Environment.NewLine & "Byvoeg", "Byvoeg.", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

           AddNew()

           'add = Cls_MessageBbox.Show("Leidraad" & Environment.NewLine & TxtLuidraad.Text & Environment.NewLine & "is Bygevoeg", "Byvoeg.", MessageBoxButtons.OK, MessageBoxIcon.Information)

       ElseIf SaveOrEdit = "Edit" Then

           Edit()
       Else

           StatusLabel.Text = " Geen Leidraad is bygevoeg"

       End If

   End Sub

AnswerRe: Help with update Pin
Pete O'Hanlon13-Apr-09 21:55
mvePete O'Hanlon13-Apr-09 21:55 
GeneralRe: Help with update Pin
hendrikbez13-Apr-09 22:26
hendrikbez13-Apr-09 22:26 
GeneralRe: Help with update Pin
Eddy Vluggen13-Apr-09 23:11
professionalEddy Vluggen13-Apr-09 23:11 
GeneralRe: Help with update Pin
hendrikbez13-Apr-09 23:59
hendrikbez13-Apr-09 23:59 
GeneralRe: Help with update Pin
Eddy Vluggen14-Apr-09 1:13
professionalEddy Vluggen14-Apr-09 1:13 
GeneralRe: Help with update Pin
hendrikbez14-Apr-09 1:33
hendrikbez14-Apr-09 1:33 
GeneralRe: Help with update Pin
Eddy Vluggen14-Apr-09 6:16
professionalEddy Vluggen14-Apr-09 6:16 
GeneralRe: Help with update Pin
hendrikbez14-Apr-09 23:24
hendrikbez14-Apr-09 23:24 
GeneralRe: Help with update Pin
Eddy Vluggen15-Apr-09 0:11
professionalEddy Vluggen15-Apr-09 0:11 
QuestionConnecting C++.NET with WebService.. Pin
shaina223112-Apr-09 21:13
shaina223112-Apr-09 21:13 
QuestionDatabase connection Pin
EmZan11-Apr-09 2:21
EmZan11-Apr-09 2:21 
AnswerRe: Database connection Pin
0x3c011-Apr-09 2:41
0x3c011-Apr-09 2:41 
GeneralRe: Database connection Pin
EmZan11-Apr-09 3:01
EmZan11-Apr-09 3:01 
GeneralRe: Database connection Pin
0x3c011-Apr-09 3:17
0x3c011-Apr-09 3:17 
GeneralRe: Database connection Pin
EmZan11-Apr-09 6:15
EmZan11-Apr-09 6:15 
GeneralRe: Database connection Pin
Colin Angus Mackay11-Apr-09 6:25
Colin Angus Mackay11-Apr-09 6:25 
GeneralRe: Database connection Pin
EmZan12-Apr-09 20:58
EmZan12-Apr-09 20:58 

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.