.net - C# Dataset error -
i have following code:
namespace company.project.dataprovider { partial class mydataset { partial class mydatatable { } } } namespace company.project.dataprovider.mydatasettableadapters { public partial class mytableadapter { public int commandtimeout { set { (int = 0; (i < this.commandcollection.length); = (i + 1)) { if ((this.commandcollection[i] != null)) { this.commandcollection[i].commandtimeout = value; } } } } } protected void objectdatasource1_objectcreating (object sender, objectdatasourceeventargs e) { company.project.dataprovider.mydatasettableadapters.mytableadapter = (company.project.dataprovider.mydatasettableadapters.mytableadapter) e.objectinstance; // set command timeout 2 minutes adapter.commandtimeout = 120; } }
when run above code, receive following error:
the type or namespace name 'company' not found (are missing using directive or assembly reference?)
what wrong in code?
now that,i receive following error.
cs1061: 'cariperiyot.rapor.test_tumraporlar' not contain definition 'commandcollection' , no extension method 'commandcollection' accepting first argument of type 'cariperiyot.rapor.test_tumraporlar' found (are missing using directive or assembly reference?) source error: line 7: set line 8: { line 9: (int = 0; (i < this.commandcollection.length); = (i + 1)) line 10: { line 11: if ((this.commandcollection[i] != null))
company.project.dataprovider.mydatasettableadapters.mytableadapter
refers class, not variable, hence assignment fails.
try:
company.project.dataprovider.mydatasettableadapters.mytableadapter foo = ...
Comments
Post a Comment