|
-
Mar 28th, 2008, 08:55 AM
#1
Thread Starter
Addicted Member
SQL database not saving
I am trying to add a row to a database, i am able to put the row into the database and view it ina datagrid while the VB program is running, but when the program closes that row dissapears. What code am i missing to update the database table instead of just the working dataset?
Code:
Dim saverow2 As DataRow
If saverow = 0 Then
saverow2 = MainDBDataSet.Assesments.NewRow()
saverow2.Item("Customer") = CustomerName
.
.
.
MainDBDataSet.Tables("assesments").Rows.Add(saverow2)
Me.TableAdapterManager.UpdateAll(Me.MainDBDataSet)
endif
-
Mar 28th, 2008, 09:18 AM
#2
Re: SQL database not saving
I would write a standard SQL INSERT Query to add the new record to my database.
-
Mar 28th, 2008, 09:21 AM
#3
Thread Starter
Addicted Member
Re: SQL database not saving
Where can i see and example of that? I am new to SQL.
VB version: Visual Studio 2008-Professional
-
Mar 28th, 2008, 09:27 AM
#4
Re: SQL database not saving
What kind of SQL server are you running? SQL Server? MySQL? Oracle?
-
Mar 28th, 2008, 09:33 AM
#5
Thread Starter
Addicted Member
Re: SQL database not saving
VB version: Visual Studio 2008-Professional
-
Mar 28th, 2008, 10:02 AM
#6
Re: SQL database not saving
See the Database FAQ section on this site.
-
Mar 28th, 2008, 10:12 AM
#7
Thread Starter
Addicted Member
Re: SQL database not saving
I see the database FAQ section, but i dont think i understand. From what i see what im doing should work right? Inserting the row to the dataset then updating the table via the dataset.
The faq says to use the update method to save the changes to the database, im using the command but its not updating the database.
Sorry for the ignorance, ive never used SQL before.
VB version: Visual Studio 2008-Professional
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|