tizzi09's Profile
Reputation: 1
Apprentice
- Group:
- New Members
- Active Posts:
- 6 (0.02 per day)
- Joined:
- 01-July 12
- Profile Views:
- 912
- Last Active:
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
Posts I've Made
-
In Topic: Using Ms ACCESS with VB.NET
Posted 19 Jul 2012
AdamSpeight2008, 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.. -
In Topic: Using Ms ACCESS with VB.NET
Posted 19 Jul 2012
aizo24, 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.... -
In Topic: Using Ms ACCESS with VB.NET
Posted 8 Jul 2012
Thanks I found a Solution. -
In Topic: Using Ms ACCESS with VB.NET
Posted 6 Jul 2012
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
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
tizzi09 has no profile comments yet. Why not say hello?