albertsmus wrote: i installed the c1 samples on another hard disk. i am testing the ClientFilterSortFind.vbproj project and i tried to change the connection string of the c1DataViewSet1 on the ConnectionOpening event by this way: Private Sub c1DataViewSet1_ConnectionOpening(ByVal sender As Object, ByVal e As C1.C1DataExtender.ConnectionOpeningEventArgs) Handles c1DataViewSet1.ConnectionOpening Dim sfile As String = "h:\Program Files\ComponentOne Studio.NET 2.0\Common\Nwind.mdb" c1DataViewSet1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sfile + ";Persist Security Info=False" End Subi got the fillowing error:System.StackOverflowException was unhandledAn unhandled exception of type 'System.StackOverflowException' occurred in System.Data.dllif i click on detail i get the following:Data error: cannot obtain valuewhat is wrong. is it possible to have some code where someone would change on the fly the connection string?Thanks for help anyway
<albertsmus> wrote in message news:191220@test.componentone.com...if i change the code lke that "Private Sub c1DataViewSet1_ConnectionOpening(ByVal sender As Object, ByVal e As C1.C1DataExtender.ConnectionOpeningEventArgs) Handles c1DataViewSet1.ConnectionOpening Dim sfile As String = "h:\Program Files\ComponentOne Studio.NET 2.0\Common\Nwind.mdb" c1DataViewSet1.Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sfile + ";Persist Security Info=False" End Sub" i get the following:System.InvalidOperationException was unhandled Message="an error ocurred while creating the form. see Exception.InnerException for details. the error is:there is no object reference in an object presence." Source="ClientFilterSortFind" StackTrace: Ïε ClientFilterSortFind.My.MyProject.MyForms.Create__Instance__[T](T Instance) ÏÏο 17d14f5c-a337-4978-8281-53493378c1071.vb:line190 Ïε ClientFilterSortFind.My.MyProject.MyForms.get_Form1() Ïε ClientFilterSortFind.My.MyApplication.OnCreateMainForm() ÏÏο H:\Program Files\ComponentOne Studio.NET 2.0\C1DataExtender\Samples\VB\ClientFilterSortFind\My Project\Application.Designer.vb:line 34 Ïε Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() Ïε Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() Ïε Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) Ïε ClientFilterSortFind.My.MyApplication.Main(String[] Args) ÏÏο 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 Ïε System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) Ïε System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) Ïε Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() Ïε System.Threading.ThreadHelper.ThreadStart_Context(Object state) Ïε System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) Ïε System.Threading.ThreadHelper.ThreadStart() albertsmus wrote: i installed the c1 samples on another hard disk. i am testing the ClientFilterSortFind.vbproj project and i tried to change the connection string of the c1DataViewSet1 on the ConnectionOpening event by this way: Private Sub c1DataViewSet1_ConnectionOpening(ByVal sender As Object, ByVal e As C1.C1DataExtender.ConnectionOpeningEventArgs) Handles c1DataViewSet1.ConnectionOpening Dim sfile As String = "h:\Program Files\ComponentOne Studio.NET 2.0\Common\Nwind.mdb" c1DataViewSet1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sfile + ";Persist Security Info=False" End Subi got the fillowing error:System.StackOverflowException was unhandledAn unhandled exception of type 'System.StackOverflowException' occurred in System.Data.dllif i click on detail i get the following:Data error: cannot obtain valuewhat is wrong. is it possible to have some code where someone would change on the fly the connection string?Thanks for help anyway http://home.componentone.com/cs/forums/191215/ShowPost.aspx#191220
<albertsmus> wrote in message news:191258@test.componentone.com...Thank you this workeed fine. I have another one question. i have a form with a c1dbnavigator, a c1truedbgrid, a c1textbox control, a c1dataviewset and i created a dataset named BASKOUSNEO2007DataSet. if i set the datasource of the c1dbnavigator and c1truedbgrid the c1dataviewset and as datamember a view called "pelatesView" which i created and set none as datasource of the c1textbox 's the form open normally. if i also set the same dataset and datamember for the c1textbox control i get the following error.System.ArgumentException was unhandled Message="it's not possible to create a childlist for the field pelatesView." Source="System.Windows.Forms" StackTrace: in System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember) Ïε System.Windows.Forms.BindingContext.UpdateBinding(BindingContext newBindingContext, Binding binding) in System.Windows.Forms.Control.UpdateBindings() in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.set_BindingContextInternal(BindingContext value) in System.Windows.Forms.ContainerControl.set_BindingContext(BindingContext value) in System.Windows.Forms.ContainerControl.get_BindingContext() in System.Windows.Forms.Control.get_BindingContextInternal() in System.Windows.Forms.Control.get_BindingContext() in System.Windows.Forms.Control.get_BindingContextInternal() in System.Windows.Forms.Control.get_BindingContext() in System.Windows.Forms.Control.get_BindingContextInternal() in System.Windows.Forms.Control.get_BindingContext() in System.Windows.Forms.Control.UpdateBindings() in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e) in System.Windows.Forms.Control.AssignParent(Control value) in System.Windows.Forms.Control.ControlCollection.Add(Control value) in System.Windows.Forms.Form.ControlCollection.Add(Control value) in Bas_Kous.frmTest.InitializeComponent() ÏÏο G:\ΠλιάÏÎ±Ï Î Î±ÏÏάληÏ\Τα ÎγγÏαÏά Î¼Î¿Ï \ergasia1\pas\VB Net\Bas_Kous\bas_kous_agores_net2\frmTest.Designer.vb:line320 in Bas_Kous.frmTest..ctor() in Bas_Kous.frmMain.MnuPel_Click(Object sender, ClickEventArgs e) ÏÏο G:\ΠλιάÏÎ±Ï Î Î±ÏÏάληÏ\Τα ÎγγÏαÏά Î¼Î¿Ï \ergasia1\pas\VB Net\Bas_Kous\bas_kous_agores_net2\frmMain.vb:line461 in C1.Win.C1Command.C1Command.OnClick(ClickEventArgs e) in C1.Win.C1Command.C1Command.Invoke(ClickEventArgs e) in ep.a(C1CommandLink A_0, a A_1) in f.c(MouseEventArgs A_0) in C1.Win.C1Command.C1ToolBar.OnMouseUp(MouseEventArgs e) inSystem.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) in System.Windows.Forms.Control.WndProc(Message& m) in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) inSystem.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) in System.Windows.Forms.Application.Run(Form mainForm) in Bas_Kous.frmMain.Main() ÏÏο G:\ΠλιάÏÎ±Ï Î Î±ÏÏάληÏ\Τα ÎγγÏαÏά Î¼Î¿Ï \ergasia1\pas\VB Net\Bas_Kous\bas_kous_agores_net2\frmMain.vb:line1 in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() in System.Threading.ThreadHelper.ThreadStart_Context(Object state) in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in System.Threading.ThreadHelper.ThreadStart()if i set to all controls as datasource the BASKOUSNEO2007DataSet and any table of it as datamember the form loads normally again. what am i doing wrong?thanks for help anywayPP http://home.componentone.com/cs/forums/191253/ShowPost.aspx#191258
<albertsmus> wrote in message news:191307@test.componentone.com... if i don't set the datafield property of the textboxes in design mode and i set them on the load event of the form then the form loads normally.What's your opinion about that? i'm asking you because as i read on this forum there are also other people who are interested for this component.Thanks for helpPP http://home.componentone.com/cs/forums/191277/ShowPost.aspx#191307
i send you the project and a database which you'll have to connect to.
if you run the project you'll see the error i refered to. this also hapens if i use a c1combo control.
PP i hope this helps
<albertsmus> wrote in message news:191457@test.componentone.com... i send you the project and a database which you'll have to connect to. if you run the project you'll see the error i refered to. this also hapens if i use a c1combo control. PP i hope this helps http://home.componentone.com/cs/forums/191422/ShowPost.aspx#191457
Others are looking for a solution to this problem.
I have found that if I do the following things work. I have a parent form where I select the MDB file, build the connection string, and then open a form with a button.
Private Sub btnBrowse_Click
MyFileForm.Dispose ' must be used if the form has more than a grid on it
MyFileForm.DataViewSet1.Connection.Close
MyFileForm.DataViewSet1.ConnectionString = txtConnectionString.Text
MyFileForm.DataViewSet1.Connection.Open
MyFileForm.DataViewSet1.Fill ' Note that autofetch is set to no
MyFileForm.ShowDialog
End Sub
If I don't do the MyFileForm.Dispose the DataViewSet1.Connection causes an error on MyFileForm.Show or ShowDialog for every control except the grids. It seems the Field property is affected during binding and raises an error.
I couldn't change a connection string at run-time from within the same form for any form with controls on it. If it only contained a grid then it seems to work.
There is even a problem with this procedure if you have a control on the form that has Enabled = False...It seems all bound controls must be enabled or have the fields set to ""
Hope this helps!