Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Insert method in ado.net disconnected Model

This is a discussion on Insert method in ado.net disconnected Model within the ASP.NET forums, part of the Web Development category; Hi there, Probably this will look like a silly question to all you masters in asp.net but i am beginner and needs help. I know how we can write queries ...

Go Back   Geeks Talk > Web Development > ASP.NET
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

ASP.NET ASP.NET and ASP Related Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2009
Junior Member
 
Join Date: Jul 2009
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
singh_indu87 is on a distinguished road
Question Insert method in ado.net disconnected Model

Hi there,

Probably this will look like a silly question to all you masters in asp.net but i am beginner and needs help. I know how we can write queries in connected model but my question is how can we do these similar opertions(insert, delete, update) in disconnected model????


Please help...
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-27-2009
Junior Member
 
Join Date: Apr 2009
Location: Pune
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
shashankkale is on a distinguished road
Re: Insert method in ado.net disconnected Model

In Disconnected mode there is DataAdapter in between your application and database.
Dataapater retrieves all data from database like.

da=new DataAdapter("Select * from SampleTable",cn);
da.fill(dt);

There are fill and update methods of DataAdapter for these operation.
once you got the data in datatable then you can eaisily do the update ,Delete ,and Add operation on DataTable.

and , Finally using update method just the database.

da.Update(dt);

Hope , this helps you.
Reply With Quote
  #3 (permalink)  
Old 09-22-2009
Junior Member
 
Join Date: Jul 2009
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
chandan02 is on a distinguished road
Re: Insert method in ado.net disconnected Model

for update

dim cmd as new sqlcommand
dim con as new sqlconnection
con=Newsqlconnecton(configurationmanager.connectionstring("connectionstringname").connectionstring)
con.open()
cmd.connection=con
cmd.comandtext="update tablename set pass=@pass where empcode=@empcode"
cmd.parameter.add("@pass",sqldbtype,varchar,50).value=txtpass.text
cmd.parameters.add("@Empcode",sqldbtype,varchar,50).value=session("empcode")
cmd.execute nonquery()
Reply With Quote
Reply

  Geeks Talk > Web Development > ASP.NET

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
what is iso model krishna sivaraman Networking 12 08-14-2009 02:41 AM
Difference between v model and and v-v model dollyg_ind Testing Issues 2 03-07-2009 01:22 PM
qc disconnected in the middile of execution madhava.sg Quality Center 1 01-09-2009 02:17 AM
Y and W Model kumsan060 Testing Issues 0 03-28-2008 08:15 AM
Insert when, Insert all when difference krishnaindia2007 Oracle 1 12-04-2007 02:10 AM


All times are GMT -4. The time now is 05:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved