<< < 24 25 26 27 28 29 30 31 32 33 34 > >>   Sort: Rank

How many ways are there to implement locking in ADO.NET
How many ways are there to implement locking in ADO.NET ? Following are the ways to implement locking using ADO.NET 1. When we call gUpdateh method of DataAdapter it handles locking internally. If the DataSet values are not matching with current data in Database it raises concurrency exception err...
2007-10-24, 5575👍, 0💬

What’s difference between “Optimistic” and “Pessimistic” locking
What’s difference between “Optimistic” and “Pessimistic” locking ? In pessimistic locking when user wants to update data it locks the record and till then no one can update data. Other user’s can only view the data when there is pessimistic locking. In optimistic locking multiple users can open th...
2007-10-24, 4874👍, 0💬

What is the use of CommandBuilder
What is the use of CommandBuilder ? CommandBuilder builds “Parameter” objects automatically. Below is a simple code which uses commandbuilder to load its parameter objects. Dim pobjCommandBuilder As New OleDbCommandBuilder(pobjDataAd apter)pobjCommandBuilder.DeriveParam eters(pobjCommand)Be careful ...
2007-10-24, 4877👍, 0💬

How can we add relation’s between table in a DataSet
How can we add relation’s between table in a DataSet ? Dim objRelation As DataRelation objRelation=New DataRelation("CustomerAddresse s",objDataSet.Tables("Customer ").Columns("Custid"),objDataSet.Tables("Addresses" ).Columns("Custid_fk"))objDataSet.Relations.Add(objRe lation)Relations can be added b...
2007-10-24, 4669👍, 0💬

How can we load multiple tables in a DataSet
How can we load multiple tables in a DataSet ? objCommand.CommandText = "Table1" objDataAdapter.Fill(objDataSet ,"Table1") objCommand.CommandText = "Table2" objDataAdapter.Fill(objDataSet ,"Table2") Above is a sample code which shows how to load multiple “DataTable” objects in one “DataSet” object....
2007-10-24, 4588👍, 0💬

Why is DataSet slower than DataReader
What is the difference between “DataSet” and “DataReader” ? Following are the major differences between “DataSet” and “DataReader” ? “DataSet” is a disconnected architecture, while “DataReader” has live connection while reading data. If we want to cache data and pass to a different tier “DataS...
2007-10-24, 4748👍, 0💬

What is basic use of “DataView”
What is basic use of “DataView” ? “DataView” represents a complete table or can be small section of rows depending on some criteria. It is best used for sorting and finding data with in “datatable”. Dataview has the following method’s Find It takes a array of values and returns the index of the r...
2007-10-24, 5403👍, 0💬

How can we add/remove row’s in “DataTable” object of “DataSet”
How can we add/remove row’s in “DataTable” object of “DataSet” ? “Datatable” provides “NewRow” method to add new row to “DataTable”. “DataTable” has “DataRowCollection” object which has all rows in a “DataTable” object. Following are the methods provided by “DataRowCollection” object Add Ad...
2007-10-24, 4977👍, 0💬

How can we check that some changes have been made to dataset since it was loaded
How can we cancel all changes done in dataset ? or How do we get values which are changed in a dataset ? For tracking down changes Dataset has two methods which comes as rescue “GetChanges “and “HasChanges”. GetChanges Returns dataset which are changed since it was loaded or since Acceptchanges was...
2007-10-24, 5101👍, 0💬

How can we save all data from dataset
How can we save all data from dataset ? Dataset has “AcceptChanges” method which commits all the changes since last time “Acceptchanges” has been executed.
2007-10-24, 4669👍, 0💬

What are the various methods provided by the dataset object to generate XML
What are the various methods provided by the dataset object to generate XML? Note:- XML is one of the most important leap between classic ADO and ADO.NET. So this question is normally asked more generally how can we convert any data to XML format. Best answer is convert in to dataset and use the bel...
2007-10-24, 4466👍, 0💬

How can we use dataadapter to fill a dataset ?
What are the steps involved to fill a dataset ? Sample code is provided in “WindowsDataSetSample” folder in CD.”LoadData” has all the implementation of connecting and loading to dataset. This dataset is finally bind to a ListBox. Below is the sample code. Private Sub LoadData() Dim strConnectionStr...
2007-10-24, 4828👍, 0💬

Which is the best place to store connectionstring in .NET projects
Which is the best place to store connectionstring in .NET projects ? Config files are the best places to store connectionstrings. If it is a web-based application “Web.config” file will be used and if it is a windows application “App.config” files will be used.
2007-10-24, 4729👍, 0💬

How can we fine tune the command object when we are expecting a single row
How can we fine tune the command object when we are expecting a single row ? Again CommandBehaviour enumeration provides two values SingleResult and SingleRow. If you are expecting a single value then pass “CommandBehaviour.SingleResult ”and the query is optimized accordingly, if you are expecting s...
2007-10-24, 5094👍, 0💬

I want to force the datareader to return only schema of the datastore rather than data
I want to force the datareader to return only schema of the datastore rather than data ? pobjDataReader = pobjCommand.ExecuteReader(Comm andBehavior.SchemaOnly)
2007-10-24, 4969👍, 0💬

How can we force the connection object to close after my datareader is closed
How can we force the connection object to close after my datareader is closed ? Command method Executereader takes a parameter called as CommandBehavior where in we can specify saying close connection automatically after the Datareader is close. pobjDataReader = pobjCommand.ExecuteReader(Comm andBeha...
2007-10-24, 5583👍, 0💬

How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures
How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures? ADO.NET provides the SqlCommand object which provides the functionality of executing stored procedures. Note :- Sample code is provided in folder “WindowsSqlClientCommand”. There are two stored proce...
2007-10-24, 4698👍, 0💬

How do we connect to SQL SERVER, which namespace do we use
How do we connect to SQL SERVER, which namespace do we use ? Below is the code, after the code I have given the explanation for it. For this sample we will also need a SQL Table setup which I have imported using the DTS wizard. Private Sub LoadData() ‘ note :- with and end with makes your code more ...
2007-10-24, 5384👍, 0💬

How can we connect to Microsoft Access , Foxpro , Oracle etc
How can we connect to Microsoft Access , Foxpro , Oracle etc ? Microsoft provides System.Data.OleDb namespace to communicate with databases like scess , Oracle etc. In short any OLE DB-Compliant database can be connected using System.Data.OldDb namespace. Note :- Small sample of OLEDB is provided in...
2007-10-24, 6630👍, 0💬

What are the various objects in Dataset
What are the various objects in Dataset ? Dataset has a collection of DataTable object within the Tables collection. Each DataTable object contains a collection of DataRow objects and a collection of DataColumn objects. There are also collections for the primary keys, constraints, and default values...
2007-10-24, 4685👍, 0💬

What is Dataset object
What is Dataset object? The DataSet provides the basis for disconnected storage and manipulation of relational data. We fill it from a data store,work with it while disconnected from that data store, then reconnect and flush changes back to the data store if required.
2007-10-24, 4691👍, 0💬

What are basic methods of Dataadapter
What are basic methods of Dataadapter ? There are three most commonly used methods of Dataadapter Fill :- Executes the SelectCommand to fill the DataSet object with data from the data source. It an also be used to update (refresh) an existing table in a DataSet with changes made to the data in the o...
2007-10-24, 4704👍, 0💬

What is the use of dataadapter
What is the use of dataadapter ? These are objects that connect one or more Command objects to a Dataset object. They provide logic that would get data from the data store and populates the tables in the DataSet, or pushes the changes in the DataSet back into the data store. ? An OleDbDataAdapter ob...
2007-10-24, 4655👍, 0💬

What is the use of command objects
What is the use of command objects ? They are used to connect connection object to Datareader or dataset. Following are the methods provided by command object ? ExecuteNonQuery :- Executes the command defined in the CommandText property against the connection defined in the Connection property for a...
2007-10-24, 4388👍, 0💬

<< < 24 25 26 27 28 29 30 31 32 33 34 > >>   Sort: Rank