Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

If i connect to an sql server using

 

Connection1

Adapter1

Dataset1

 

I want to save a new record that I have added.

 

so

 

--Fill on form load--

adapter1.fill(dataset,"testdb")

 

 

--Click the AddNew Button--

Me.BindingContext(DataSet1, "testdb").CancelCurrentEdit()

Me.BindingContext(DataSet1, "testdb").AddNew()

 

*fill in my fields on the form (which are bound to the dataset)*

 

I now want to update the sql server so I thought it would be a simple

 

--Update--

adapter1.update(dataset1,"testdb")

 

But that doesnt work. :(

 

Please can someone help me with my dataset?

 

Nick

Posted

Oh Dear I'm a bit lost now.

 

Basically the problem is that I can create a new record etc in the dataset but then when you hit save it isnt updating the sql server. So if you exit and re-open the application the changes are gone because the dataset has been wiped.

 

Ive just discovered that I haven't specified the Update Command Text which is obviously the source of the problem.

 

Newbie Time,

 

I dont know how to write an update command string

 

My select string:

 

SELECT ID, [Telephone ], [MCCB number ], , Surname, Firstname, [Company Name], [Ad line 1], [Ad line 2], [Ad line 3], [Ad line 4], Postcode, [introduced by], [Date Added], [Come from] FROM mailinglist

 

if i wanted to say update ID from textbox1 (which is bound to the ID field) how do i specify that?

 

UPDATE mailinglist SET ID=?

 

Kind Regards,

 

Nick

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...