[Sample Of Apr 9th] How to create and execute SqlCommand in ADO.NET

  Sample Download : http://code.msdn.microsoft.com/How-to-Create-and-Execute-86922261 We can create and execute different types of SqlCommand. In this applilcation, we will demonstrate how to create and execute SqlCommand: 1. Create different types of SqlCommand; 2. Execute SqlCommand in different ways; 3. Display the result.  You can find more code samples that demonstrate the most typical programming scenarios…

0

[Sample Of Mar 24th] How to retrieve the Identity value after inserting a data using ADO.NET

  Sample Download : http://code.msdn.microsoft.com/How-to-Retrieve-the-511acece We often set a column as identity column when the values in the column must be unique. And sometimes we need the identity values of new data. In this application, we will demonstrate how to retrieve the identity values: 1. Create a stored procedure to insert data and return identity…

1

[Sample Of Mar 17th] How to Use DbDataReader.GetInt32 Method

  Sample Download : http://code.msdn.microsoft.com/How-to-Use-DbDataReaderGetI-dd8b52e9 DbDataReader.GetInt32 Method gets the value of the specified column as a 32-bit signed integer. In this snippet, we will demonstrate how to use DbDataReader.GetInt32 Method. 1. Create DbConnection, DbCommand; 2. Create DbDataReader to read data; 3. Use DbDataReader.GetInt32 method to get the Data of Int32 type;  You can find more…

0

[Sample Of Mar 14th] How to Use IDataAdapter.GetFillParameters Method

  Sample Download : http://code.msdn.microsoft.com/How-to-Use-IDataAdapterGetF-9b8e4be9 Now there’s no code about the IDataAdapter.GetFillParameters Method in MSDN, and the customers want it. In this snippet code, we will demonstrate how to use the IDataAdapter.GetFillParameters method: 1. Create DbConnection, DbCommand; 2. Add the Parameters to the DbCommand; 3. Create the DataAdapter and set the Connection and Command; 4….

0

[Sample Of Mar 4th] How to Get Schema Information from Database

  Sample Download : http://code.msdn.microsoft.com/How-to-Get-Schema-b66d62e2 Sometimes we may need the schema information of the database, tables or some columns. In this application, we will demonstrate how to get schema information from database: 1. In this application, we will use the SqlConnection.GetSchema Method. 2. We will use the Schema Restrictions to get the specified information. 3….

0

[Sample Of Feb 24th] How to Use IDataRecord.GetDataTypeName Method

  Sample Download : http://code.msdn.microsoft.com/How-to-Use-IDataRecordGetDa-7168b1cf Now there’s no code about the IDataRecord.GetDataTypeName Method in MSDN, and the customers want it. In this snippet code, we will demonstrate how to use the DbDataReader.GetInt32 method: 1. Create DbConnection, DbCommand; 2. Create DbDataReader to read data; 3. Use IDataRecord.GetDataTypeName method to get the data type information for the…

0

[Sample Of Jan 31st] How to use the custom type in DataTable

  Sample Download: CS Version: http://code.msdn.microsoft.com/CSDataTableCustomType-80d85bbf VB Version: http://code.msdn.microsoft.com/VBDataTableCustomType-457276e3   This sample demonstrates how to use the custom type in DataTable: 1. Set the custom type as the datatable primary column type; 2. Sort the datatable by the custom type; 3. Write the datatable into the Xml file; 4. Read the Xml file into the…

0

[Sample Of Jan 21st] How to implement deep clone/duplicate entity objects using serialization and reflection

  Sample Download : CS Version: http://code.msdn.microsoft.com/CSEFDeepCloneObject-12a5cb95 VB Version: http://code.msdn.microsoft.com/VBEFDeepCloneObject-33a90358 This sample demonstrates how to implement deep clone/duplicate entity objects using serialization and reflection. When we need some similar entity objects, we can create them manually. If there are many properties in the entity types, it means more codes.  If we use the MemberwiseClone method…

0

[Sample Of Jan 4th] How to Query in a DataSet with Multiple DataTables

  Sample Download : http://code.msdn.microsoft.com/How-to-Query-in-a-DataSet-39a02f42 We can use traditional SQL queries to get data from the data source, but we cannot use SQL to query in DataSet. In this sample, we will demonstrate how to use Expression to query in a DataSet: 1. Create a DataSet with two DataTables; 2. Create the constraints between the…

0

[Sample of Nov 27th] How to access untyped/strong typed DataSets by using LINQ

  Sample Download :  http://code.msdn.microsoft.com/CSLinqToDataSets-5f6596c4 This sample demonstrates how to use Microsoft Language-Integrated Query (LINQ) technology to access untyped DataSet and strong typed DataSet. You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the…

0