Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 1.89 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. C# Dataset error
  2. namespace Company.Project.DataProvider
  3. {    
  4.     partial class MyDataSet
  5.     {
  6.         partial class MyDataTable
  7.         {
  8.         }
  9.     }
  10. }
  11.  
  12. namespace Company.Project.DataProvider.MyDataSetTableAdapters
  13. {
  14.     public partial class MyTableAdapter
  15.     {
  16.         public int CommandTimeout
  17.         {
  18.             set
  19.             {
  20.                 for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1))
  21.                 {
  22.                     if ((this.CommandCollection[i] != null))
  23.                     {
  24.                         this.CommandCollection[i].CommandTimeout = value;
  25.                     }
  26.                 }
  27.             }
  28.         }
  29.     }
  30.  
  31.     protected void ObjectDataSource1_ObjectCreating
  32.         (object sender, ObjectDataSourceEventArgs e)
  33.     {
  34.         Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter =  
  35.             (Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter)
  36.               e.ObjectInstance;
  37.         // Set command timeout to 2 minutes
  38.         adapter.CommandTimeout = 120;
  39.     }
  40. }
  41.        
  42. CS1061: 'CariPeriyot.Rapor.TEST_TumRaporlar' does not contain a definition
  43. for 'CommandCollection' and  no extension method 'CommandCollection'
  44. accepting a first argument of type 'CariPeriyot.Rapor.TEST_TumRaporlar'
  45. could be found (are you missing a using directive or an assembly reference?)
  46.  
  47. Source Error:
  48.  
  49. Line 7:         set
  50. Line 8:         {
  51. Line 9:           for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1))
  52. Line 10:           {
  53. Line 11:              if ((this.CommandCollection[i] != null))
  54.        
  55. Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter =  
  56.    (Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter)
  57.     e.ObjectInstance;
  58.        
  59. Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter adapter =  
  60.    (Company.Project.DataProvider.MyDataSetTableAdapters.MyTableAdapter)
  61.     e.ObjectInstance;