objDataTable.Columns.Add("Student Id", typeof(int)); objDataTable.PrimaryKey = "Student Id";
am already tried many ways but i cant
in C # how to set the primary key in this line, friends, please help
thanks in advance
Try the following:
DataTable objDataTable = new DataTable(); objDataTable.Columns.Add("Student Id", typeof(int)); objDataTable.PrimaryKey = new DataColumn[] { objDataTable.Columns["Student Id"] };
The property PrimaryKeyhas Type: System.Data.DataColumn[]no string.
PrimaryKey
Type: System.Data.DataColumn[]
Source: https://habr.com/ru/post/1650265/More articles:What happened to this face detection in webcams? - pythoncalculate the area of a 2-dimensional ellipsoid in R - rWhat is the difference between these Perl JSON modules? - jsonUsing the unresolved identifier "GMSPlacesClient" in xcode 7.3.1 - iosParsing Xml into an array (Swift) - swiftGoogleMaps SDK classes of undeclared type or unresolved identifier - iosSQL SELECT only rows with a MAX column value from two different tables - sqlИспользование неразрешенного идентификатора "GMSServices" - iosInitializing an explicit GO array - arraysHow to develop several modules parallel to the application module in Angular 2? - angularAll Articles