When do we use imports.system.sqlclient and when imports.system.oledb?What is the purpose of using executenonquery?

Showing Answers 1 - 6 of 6 Answers

Anupam Rai

  • Jun 8th, 2007
 

System.Data.OleDB
 It contains the objects that we  use to connect to a data source via an OleDB provider , such as OleDbConnection,  OleDBCOmmand
 

System.Data.SqlClient
It contains objects that we use to connect to a data source via Tabular data stream interface provided by Microsoft Sql Server. This can be generally used to provide better performance because it removes some of the intermediate layers required by the OleDB provider. 

itgirl

  • Dec 14th, 2007
 

Executenonquery does not return any value unlike executequery which return values for select, insert, update

  Was this answer useful?  Yes

system.oledb or system.sqlclient both are use for connectvity to database


execute query returns value its uses selct statement
executenon query not return value through this we insert, update,delete ,statement performed

  Was this answer useful?  Yes

imports.system.sqlclient is used when using sql server as database
imports.system.sqlclient is used when using access as database
executenonquery is used when executing DML (insert, update delete operations).
hope this answers the question adequately

  Was this answer useful?  Yes

Diptikanta

  • Apr 3rd, 2008
 

Imports system.sqlclient is used only for MSSqlserver database.
Imports system.oledb is used for any other databases including MSSqlserver.

Executenonquery is used for Insert,Update,Delete command. And It returns an integer value that number of records affected.

And Executequery is used for select command and it returns an result object.

  Was this answer useful?  Yes

pradhib.l

  • Aug 20th, 2008
 

There are two methods used for disconnected architecture one is
1) Execute Scaler
2) execute nonquery

Execute Scalar: It is for math functions (min,max,add,sub)

Execute Nonquery: It is used for insert,update,delete operations.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions