Posts

Showing posts from April, 2009

C Sharp Source Code #1

Collapses and hides sections of code using #Region Directive #Region "Private Member Variables" Private _productID As Integer Private _productName As String Private _quantityPerUnit As String #End Region Difference between DataSet Copy and Clone DataSet.Clone copies only the datatable structure with its schema, relations, and constraints of the dataset not the data, where as DataSet.Copy copy the both. DataSet dsEmployees = PopulateEmployeeData(); DataSet myCloneDS = dsEmployees.Clone(); public DataSet PopulateEmployeeData() { DataTable dtEmployee = new DataTable(); DataColumn myCol; DataRow myRow; myCol = new DataColumn(); myCol.ColumnName = "EmployeeID"; dtEmployee.Columns.Add(myCol); myCol = new DataColumn(); myCol.ColumnName = "EmployeeName"; dtEmployee.Columns.Add(myCol); //Add some rows to employee datatable for (int i = 0; i { myRow = dtEmployee.NewRow(); myRow["EmployeeID"] =...