Hi,
I'm currently evaluating the Trial of ES2008 (very impressed).
However, I'm having a problem with populating a collection (code below):
Code:
1 esProviderFactory.Factory = New esDataProviderFactory
2
6 Dim dayCountTotal As Long = DateDiff(DateInterval.Day, dtpFromDate.Value, dtpToDate.Value)
7
8 Using collDTG As New BLL.BLL.SignalrefCollection
9 For dayCount As Long = 0 To dayCountTotal + 1
10 Dim workingDate As Date = DateAdd(DateInterval.Day, dayCount, dtpFromDate.Value).Date
11 For hourCount As Integer = 7 To 18
12 For minuteCount As Integer = 0 To 55 Step 5
13 Dim currentDate As BLL.BLL.Signalref = New BLL.BLL.Signalref
14 Dim dtg As String = String.Empty
15 Dim signalDateTime As Date = CDate(workingDate & " " & hourCount & ":" & minuteCount)
16
17 dtg = Format(workingDate.Day, "00") & Format(hourCount, "00") & Format(minuteCount, "00") & "z" & MonthName(workingDate.Month, True) & workingDate.Year.ToString.Substring(2, 2)
18 Debug.Print(signalDateTime.ToString)
19 currentDate.SignalDatetime = signalDateTime
20 currentDate.SignalDtg = dtg
21 collDTG.AttachEntity(currentDate)
22 Next minuteCount
23 Next hourCount
24 collDTG.Save()
25 Next dayCount
26 End Using
When the procedure gets to "collDTG.Save" (line 24), an error is throw
"System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="EntitySpaces.Interfaces"
StackTrace:
at EntitySpaces.Interfaces.esConnection.get_SqlAccessType() at EntitySpaces.Core.esEntityCollection.Save() at DTG_Generator.Form1.btnGenerate_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at DTG_Generator.My.MyApplication.Main(String[] Args) at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
InnerException:
I have the references to EntitySpaces.Core and Interfaces in my project (and Imports statements).
I definitely will buy this product if this can be resolved.
Also, is it possible to change the default stored procedure prefix (usp_ rather than proc_)?
Any ideas?
Cheers
Jules