By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,433 Members | 771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,433 IT Pros & Developers. It's quick & easy.

Save dataset using Oledb Connection in VB.NET

mafaisal
100+
P: 142
Hello

I am Using Vb.Net 2005 And Sql2005

See This

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim RsSave as new adodb.recordset
  3. RsSave.open "Select * From Table Where 1=2 ",Con,CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic
  4.  
  5. con.Begintrans
  6.  
  7. RsSave.AddNew
  8. RsSave.Fields(0).Value = textbox1.text
  9. RsSave.Fields(1).Value = textbox2.text
  10. RsSave.Fields(2).Value = textbox3.text
  11. RsSave.Update
  12.  
  13. Con.Commitrans
  14.  
This Just eg for saving to databse using Adodb connection And Recordset

My Question is Hw to Save like this using Oledb Connection And Dataset

I will Try for that but not getting

Faisal
May 4 '08 #1
Share this Question
Share on Google+
2 Replies


Dököll
Expert 100+
P: 2,364
Hello

I am Using Vb.Net 2005 And Sql2005

See This

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim RsSave as new adodb.recordset
  3. RsSave.open "Select * From Table Where 1=2 ",Con,CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic
  4.  
  5. con.Begintrans
  6.  
  7. RsSave.AddNew
  8. RsSave.Fields(0).Value = textbox1.text
  9. RsSave.Fields(1).Value = textbox2.text
  10. RsSave.Fields(2).Value = textbox3.text
  11. RsSave.Update
  12.  
  13. Con.Commitrans
  14.  
This Just eg for saving to databse using Adodb connection And Recordset

My Question is Hw to Save like this using Oledb Connection And Dataset

I will Try for that but not getting

Faisal
Greetings, mafaisal!

I took the liberty of modifying your title to see if you can get better hits that way; changed it from this 'Using Dataset in OledbConnection' to the above.

Secondly, I do believe you will get better support in VB.NET forum. Will send there; we aslo have and SQL forum, care to see what ideas you can pick up there also.

Good luck with the project!

Dököll
May 5 '08 #2

lotus18
100+
P: 866
Hi

You need to import System.Data.OleDb.

Rey Sean
May 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.