Hi, I merge a dataset into another dataset in my C# application. While doing the dataset.Merge(myParamDataSet), the event 'position change' is raised from the 'bindingsource'. Is there a way to stop all bindingsource events before the merge & after the merge? Best regards, Jens
JensB
Posts
-
Dataset Merge triggers positionchange event bindingsource -
Bindingsource C# Adding New EventHi, We are using data-binding & typed datasets in our C# .NET 2.0 application (VS2005). We have a bindingsource which has as datasource a dataset and as datamember a datatable. In the form we have a grid which is binded to that bindingsource. We allow new records to be created on the grid. When the users navigates to a new row, the "Adding New" event is raised. We would like to handle this event because we need to set the key of the record to a new Guid. We get as parameter of the "Adding New" function "AddingNewEventArgs e". Then e.NewObject should be set. Well, this doesn't work. After setting the e.NewObject the program crashes. It's like it does not accept my Typed DataRow. Maybe the collection underneath in the Bindingsource accepts another type? Any ideas? Best regards, Jens
-
Typed dataset with cascade delete using TableAdapterHi, Performing the updates in the correct order is not a good solution aswell. I have put the table adapter update of parent at the end, but this comes with another problem. Let's say you have to create the parent, the table adapter needs to first do the inserts of the parents, otherwise the children won't be added because of the relationship! Any other solutions? Best regards, Jens
-
Typed dataset with cascade delete using TableAdapterHi, We have implemented a Windows c# application using a typed dataset (ADO.NET) I've modified the relation so the childs get deleted when the parent is deleted. Delete action: cascade. In the function where I process all the changes in the dataset (Dataset.GetChanges()), I create for every table 1 adapter & call the .Update() function. When the first adapter (for parent) is created & called the .Update() function, the parent and all its childs are deleted due to the relationship (Delete action: cascade) A few lines further on, the adapter of the childs are called and the .Update() function throws an exception because the child is already deleted on the DB! This is very ennoying and I really don't know how to solve this problem. Any idea how to solve this? I tested it out with my own SqlCommand object and the deletion of the parent & childs did not cause any problems. I'd really love to keep the relationship so the childs get deleted automatically. This allows me to write less code :) Best regards, Jens
-
Generate documentationHi, I already worked with C# a while and I'd like to generate documentation. I've seen you can use '///' to add info in XML-style. So the XML can be parsed by using for example NDoc. Is NDoc the best tool to use to generate C# Documentation? Any other software that I should use? (NDoc projet is not being update lately...) Any advice/suggestions are welcome :) Greetings, Jens
-
text to numberHi, I have a little problem converting a string to a number. Situation: string : "1.555,23" thousand seperator = "." decimal seperator = "," Why doesn't this help?
lconv* pConv = localeconv(); pConv->decimal_point = ","; pConv->thousands_sep = ".";
Using the default "C-locale", things get messed up. How can I make sure it uses the (above) seperators so i get correct conversion? Best regards, Jens -
Linux c++ management of processesHi, I'm writing a batchmanager which launches some jobs (processes as children). Is there a good book about processes? What's the best way to know when children have done executing? Is there any good book available for this? Greetings, Jens
-
Catch c++ runtime library errorHi, i have already done that. The memory is not incremental, memory usages stays the same. Catching std::overflow_error& exception, won't this catch the runtime exception and prevent the program from displaying the error? Greetings, Jens
-
Catch c++ runtime library errorHi I have a problem with a certain application which causes a runtime library error. This error is not frequently shown, the program can run about 3+ weeks non-stop, working perfectly .. sometimes it only lasts about 2 weeks. When it crashes, i get an runtime error : Microsoft Visual C++ Runtime library Runtime Error ! Program: myprogram.exe abnormal program termination 'OK' I want to catch c++ runtime librarys errors and avoid having to click on the 'OK' button. The program is build in release-mode, so i don't understand why i still get that message. I thought this would only happen on debug-programs. The program should crash & close yes, but not show any dialog. We monitor the program frequently & rerun the program automatically if necessary. I know i should find the error first, but i shouldn't swear neither ;) Best regards, Jens
-
m_pMainWnd is NULL in CWinApp::RunHi, I tried to return false, but then the exit-code of the process is '1'. The exit-code needs to be '0'. I removed the m_pMainWnd = &dlg; line alsoo. Greetings, Jens -- modified at 9:40 Monday 12th September, 2005
-
m_pMainWnd is NULL in CWinApp::RunHi, In my app::InitInstance()
{ ... CMyDlg dlg; m_pMainWnd = &dlg; dlg.DoModal(); return TRUE; } The 'CMyDlg' has an internal timer that gets activated after 1 second, and starts executing some actions. After done, the timer is killed and 'CDialog::OnOK' is called. This gets the dialog closed. In the app i need to return TRUE, else i got exit code != 0. But now, i get this ennoying warning: Warning: m_pMainWnd is NULL in CWinApp::Run - quitting application. Any way to get this (annoying) warning out of the program? Greetings, Jens
-
Automated buildingHi, I have alot of MFC and C++ Console applications & static library's. I build all applications on Windows OS & main applications (console) on Linux (gcc gmake). Which program do you guys advise to use to automated building so I can do building easily on Win & Linux? ant? Scons? I realise this is not a general C++ question, but since you guys alsoo waste a lot of time building apps maybe anyone could give me some tips .. Greetings, Jens
-
Problem linkageHi, I seem to have a problem with linking an MFC application. I get the following errors: error LNK2001: unresolved external symbol __imp__floor error LNK2001: unresolved external symbol __imp__atof error LNK2001: unresolved external symbol __imp__atof Am i forgetting a library to link with or what could cause this problem? Best regards, Jens
-
Linking issuesHi, I have an MFC application which gives problems to link (not compile). I get the following errors: error LNK2001: unresolved external symbol __imp__floor error LNK2001: unresolved external symbol __imp__atof error LNK2001: unresolved external symbol __imp__atof I ignored the library 'msvcrtd.lib' in my project. Any ideas how I can solves these two problems? Greetings, Jens
-
.DSP informationHi, I wanted to add 'code' into the .DSP file. I have set an environment variable with text in it ("mylib.lib test2.lib" etc) in it, and i want it to be added in the include list of libs in the project. Any ideas? Best regards, Jens
-
Form returning valueHi Guru's, Let's say I have made a Question Dialog which has 2 buttons: a Yes and a No button. When a user clicks on the main form 'Delete file' button the question dialog is called like this: frmQuestionDialog.show vbmodal. How can i know after calling the .show which button Yes/no they have pressed at the question dialog? Best regards, Jens
-
.DSP informationHi Franks, First of all, I am very interested in reading your code that can examine a .dsp file (.dsw is alsoo interesting). I want to have a better look at what a .dsp contains and really needs. Can I have your e-mail address please? Best Regards, Jens
-
.DSP informationHi, Is there any way to get documentation about a visual c++ .dsp file? I would like to be able to add parameters in the .DSP file. (environment variables for example) Anyone could give me a good tutorial/link/documentation about this issue? Thank you, Jens
-
Windows .libsHi, I have some MFC projects which use the following libs: kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib Are these libs always necessary for using MFC? How can I know which libs to use and will I get errors compiling/linking when those deleted from the project? Best regards, Jens
-
Add encoding in xml fileHi, I have been using a wrapper class around IXMLDOMDocument to save to an XML file. (Available here on CP) How can i save the type of encoding in that XML file? Best regards, Jens