Killsoft Sugdok

how to insert/add record in ms access using vb.net

Go down

how to insert/add record in ms access using vb.net

Post by putayputay on Mon Mar 11, 2013 6:45 am

Try
Dim SqlQuery As String = "INSERT INTO FullNameTable (FirstName,MiddleName,LastName) VALUES ('" & txtFName.Text & "', '" & txtMName.Text & "','" & txtLName.Text & "')"
Dim SqlCommand As New OleDbCommand

With SqlCommand
.CommandText = SqlQuery
.Connection = conn
.ExecuteNonQuery()
End With
MsgBox("One record Successfully Added..")
loadListView()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

putayputay
Newbie
Newbie

Posts : 10
Join date : 2013-03-09

Back to top Go down

sir ask ko lang po about sa nangyari sa ginawa ko if ano po yung mali

Post by weirdo on Thu Oct 10, 2013 5:54 am

sir baka po pwede paki tingen itong gawa ko ginaya ko naman po yung nasa video...pero may error pa din

weirdo
Newbie
Newbie

Posts : 2
Join date : 2013-10-10

Back to top Go down

s

Post by weirdo on Thu Oct 10, 2013 6:47 am

pano po ba maglagayn ng picture?

weirdo
Newbie
Newbie

Posts : 2
Join date : 2013-10-10

Back to top Go down

Re: how to insert/add record in ms access using vb.net

Post by ii88oio88ii on Sat Feb 08, 2014 3:25 pm

Private Sub btnInsert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInsert.Click
        For i = 0 To DataGridView1.Rows.Count - 1
            Dim row1 As String = DataGridView1.Rows(i).Cells(1).Value.ToString

            Dim sqlquery As String = "INSERT INTO tblName (FullName) VALUES ('" & row1 & "')"
            Dim sqlcommand As New OleDbCommand

            With sqlcommand
                .CommandText = sqlquery
                .Connection = conn
                .ExecuteNonQuery()
            End With
        Next

        MsgBox("Record successfully added!")
        DataGridView1.Rows.Clear()

        btnLoad.PerformClick()
    End Sub


pano po ba kung 2 columns na yong iiinsert mo sa database?? example "FullName" and "Address" columns sa database.. tnx

ii88oio88ii
Newbie
Newbie

Posts : 5
Join date : 2014-02-08

Back to top Go down

Re: how to insert/add record in ms access using vb.net

Post by ii88oio88ii on Sat Feb 08, 2014 3:26 pm

btw using datagridview po e2..  Sad

ii88oio88ii
Newbie
Newbie

Posts : 5
Join date : 2014-02-08

Back to top Go down

Re: how to insert/add record in ms access using vb.net

Post by chandara on Sat May 03, 2014 2:05 pm

I try your code but I get like this: Object reference not set to an instance of an object.

chandara
Newbie
Newbie

Posts : 1
Join date : 2014-05-03

Back to top Go down

please help!

Post by belle123 on Sat Dec 20, 2014 2:07 pm

hello po,
i saw your video but unfortunately, walang na save sa database ko... 

im really wondering bakit gumana ang sayo, i followed all the codes and instructions naman... ang pinalitan ko lang ay ang "name ng database, table, field name and textbox and buttons." 

PLEASE... i badly need your help... Neutral Neutral
avatar
belle123
Newbie
Newbie

Posts : 1
Join date : 2014-12-20

Back to top Go down

Re: how to insert/add record in ms access using vb.net

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum