abhishek415's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
57 (0.07 per day)
Joined:
30-June 12
Profile Views:
3,227
Last Active:
User is offline Feb 21 2013 05:55 AM
Currently:
Offline

Previous Fields

Country:
IN
OS Preference:
Windows
Favorite Browser:
Mozilla
Favorite Processor:
Intel
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   abhishek415 has not set their status

Posts I've Made

  1. In Topic: Problem in updating the ms access database

    Posted 15 Oct 2012

    No Sir, I didnot get any error message in message box.
    If i had got such error message, then it would have been corrected by me.
  2. In Topic: Problem in updating the ms access database

    Posted 15 Oct 2012

    Catch ex As Exception
    MsgBox(ex.ToString)
    End Try
  3. In Topic: Problem in updating the ms access database

    Posted 15 Oct 2012

    I have putted this code in the button_click event.
    and i have also applies try catch statement too. but that i did not copied here.
    But still the error was not shown. :-(
  4. In Topic: Problem in updating the ms access database

    Posted 15 Oct 2012

    Thanks Again Charlie.
    I made a very stupid mistake.
    The problem was with the order of parameters as said by you earlier.
  5. In Topic: Problem in updating the ms access database

    Posted 15 Oct 2012

    now i have put my connection string into the condition.
    but now also the same problem is occuring.

    There is no error , program terminates after successful completion but database is not updated.My new code is:
    Dim dbPath As String = "D:\WindowsApplication1\Medical.mdb"
                    con.Close()                con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
                    & "Data Source=" & dbPath & ";Jet OLEDB:Database Password=guptaji;"
    
                    Dim bal As Integer = Val(Me.TextBox2.Text) - Val(Me.TextBox7.Text)
                    MsgBox(bal)
                    str = ("UPDATE Add1 SET [Quantity]=@Quantity where [PName] =@PName")
                    Dim acscmdup1 As New OleDb.OleDbCommand()
                    acscmdup1.CommandText = str
                    If (con.State = ConnectionState.Closed) Then
                        con.Open()
                    End If
                    acscmdup1.Connection = con
                    With acscmdup1
                        .Parameters.AddWithValue("@PName", Me.ComboBox3.Text)
                        .Parameters.AddWithValue("@Quantity", bal)
    
                        .ExecuteNonQuery() 'Execute command
                    End With
                    acscmdup1.Dispose()
                    MessageBox.Show("Database Updated", "Updated..", MessageBoxButtons.OK, MessageBoxIcon.Information)
                    con.Close()
    
    


    Help

My Information

Member Title:
D.I.C Head
Age:
24 years old
Birthday:
November 7, 1989
Gender:
Location:
Gurgaon
Full Name:
Abhishek Gupta
Years Programming:
5
Programming Languages:
C,C++,Java,VB.Net,VB 6.0

Contact Information

E-mail:
Private
Facebook:
http://www.facebook.com/#!/abhishekgupta007

Friends

Comments

Page 1 of 1
  1. Photo

    varsha0802 Icon

    02 Jul 2012 - 06:39
    Hi, I don't have any knowledge about vb.net but I am into C#.net.
Page 1 of 1