Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Trying to Insert a Record (http://www.velocityreviews.com/forums/t77645-trying-to-insert-a-record.html)

Curt Emich 05-07-2004 04:28 PM

Trying to Insert a Record
 
I'm trying to insert a new record into an MS Access table. The code below
compiles and runs, but it doesn't write a record into the table. Can
someone tell me why?

Dim thisSelectCommand As New OleDb.OleDbCommand("SELECT * FROM Sessions",
Me.OleDbConnection1)

Dim thisDataAdapter As New OleDb.OleDbDataAdapter(thisSelectCommand)

Dim thisDataset As New System.Data.DataSet()

thisDataAdapter.Fill(thisDataset, "Sessions")

thisDataAdapter.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Sessions
(Notes) VALUES('Yadda')")

thisDataAdapter.Update(thisDataset, "Sessions")

thisDataset.AcceptChanges()



=?Utf-8?B?TWFuamE=?= 05-07-2004 04:56 PM

RE: Trying to Insert a Record
 
this another solution to add record
---------------
Dim thisinsDataAdapter As OleDb.OleDbDataAdapte
Dim thisinsDataset As New System.Data.DataSet(
thisinsDataAdapter= New OleDb.OleDb.OleDbDataAdapter("INSERT INTO Session
(Notes) VALUES('Yadda')"
thisinsDataAdapter(thisinsDataset, "Sessions"

and you can refresh you 1st dataset again

hope it help u
Manj



All times are GMT. The time now is 11:55 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57