tizzi09's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
New Members
Active Posts:
6 (0.01 per day)
Joined:
01-July 12
Profile Views:
2,197
Last Active:
User is offline Aug 04 2012 12:53 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
Mozilla
Favorite Processor:
Intel
Favorite Gaming Platform:
Playstation
Your Car:
Who Cares
Dream Kudos:
0
Icon   tizzi09 has not set their status

Posts I've Made

  1. In Topic: Using Ms ACCESS with VB.NET

    Posted 19 Jul 2012

    View PostAdamSpeight2008, on 19 July 2012 - 01:46 PM, said:

    tizzi09: Please use the code tags to surround your code.



    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            hoc.Open()
            Dim sqlquery As String = _
             "INSERT INTO cerutti(fname, sname, matricNo ,sex) VALUES(@fname,@sname,@matricNo,@sex) "
            Dim query As OleDbCommand = New OleDbCommand(sqlquery, hoc)
            query.Parameters.Add(New OleDbParameter("@fname", txtfName.Text))
            query.Parameters.Add(New OleDbParameter("@sname", txtsName.Text))
            query.Parameters.Add(New OleDbParameter("@matricNo", txtMatric.Text))
            query.Parameters.Add(New OleDbParameter("@sex", txtSex.Text))
            Dim adapter As New OleDbDataAdapter(sqlquery, hoc)
            Dim dt As New DataTable
    
    
    
    
                query.ExecuteNonQuery()
                MsgBox("Done")
                hoc.Close()
                Me.Close()
        End Sub
    End Class
    



    I just noticed whenever i run the program and fill the text boxes and click save, it confirms with a MsgBox message that its done but it doesn't save in the access database i created. So somehow i went back to my Form1.vb and checked the Data Source tab, right clicked on it, selected preview and i was amazed it was saving it there instead of saving it in the access db..
  2. In Topic: Using Ms ACCESS with VB.NET

    Posted 19 Jul 2012

    View Postaizo24, on 06 July 2012 - 05:48 PM, said:

    try this one...


    put this on the click event of your button


    dim sql as String = "INSERT INTO yourTable VALUES('" & txtFname.text & "'," _
                      & "'" & txtLname.text & "'," ' And so on...
    dim da as New SqlDataAdapter(sql,"your connection string") 
    dim dt as new DataTable
    
    try
    da.fill(dt)
    catch ex
    throw ex
    end try
    
    


    and that's that :)

    i hope this one helps :)

    ...

    I'm confused.. Below is my code, can you check it and help me find the bug in it....
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            hoc.Open()
            Dim sqlquery As String = _
             "INSERT INTO cerutti(fname, sname, matricNo ,sex) VALUES(@fname,@sname,@matricNo,@sex) "
            Dim query As OleDbCommand = New OleDbCommand(sqlquery, hoc)
            query.Parameters.Add(New OleDbParameter("@fname", txtfName.Text))
            query.Parameters.Add(New OleDbParameter("@sname", txtsName.Text))
            query.Parameters.Add(New OleDbParameter("@matricNo", txtMatric.Text))
            query.Parameters.Add(New OleDbParameter("@sex", txtSex.Text))
            'Dim adapter As New OleDbDataAdapter(sqlquery, hoc)
            'Dim dt As New DataTable
            'adapter.Fill(dt)
    
    
    
            query.ExecuteNonQuery()
            MsgBox("Done")
            hoc.Close()
            Me.Close()
        End Sub
    End Class
    



    I just noticed whenever i run the program and fill the text boxes and click save, it confirms with a MsgBox message that its done but it doesn't save in the access database i created. So somehow i went back to my Form1.vb and checked the Data Source tab, right clicked on it, selected preview and i was amazed it was saving it there instead of saving it in the access db....
  3. In Topic: Using Ms ACCESS with VB.NET

    Posted 8 Jul 2012

    Thanks I found a Solution.
  4. In Topic: Using Ms ACCESS with VB.NET

    Posted 6 Jul 2012

    View PostVishal1419, on 01 July 2012 - 07:36 AM, said:

    Can you give more information on that?
    i want button submit to save all student info into my MS Database.

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Interests:
Java Programming, PHP, CSS, JAVASCRIPT, VB.NET, C
++, ETC.
Full Name:
Mattieu

Contact Information

E-mail:
Click here to e-mail me

Comments

tizzi09 has no profile comments yet. Why not say hello?