I second NDoc, but as you have noticed they haven't released a binary for a while. Although there are currently working on a release for 2.0 framework features (like generics). I have a few c# 2.0 projects which could do with this.
Thanks for your time to read my request for a help. I developed my windows application with C#, which has many background workers working at the same time, opening and closing sql databases, modifying sql tables etc. Now, very often I get this error message, " There is already an open DataReader associated with this Command which must be closed first.". I dont know why its happenning sometimes and sometimes not. Is that the reason one thred and another thread conflicting each other when they try to read or modify same sql database ? And sometimes, I get some weired error saying "in order to execute the sqlcommand, connection must be open. ", And I dont see any reason why connection is getting closed before that sqlcommand execution. Now I had to place if(myConn.State == ConnectionState.Close) myConn.Open() ; before every sqlcommand. Even after that I am getting same error sometimes. Can anyone please give me some clue to solve and seal this problem permanently.
You can have any number of connections open to the database, so that is not the problem. The problem is most likely how you use the connection objects in your code. You can't share connetions between threads.
Thanks for your reply. Actually I am using same instance of sqlconnection all over my code because, when I used different instance of sqlconnection, I face another problem. If One connection made a change in the database, another connection doesn't reflect the change. It still retrieive old values from SQL unless that connection itself did not do the changes in SQL. Is there any way to synchronize all changes made by different sql connection instances ?
Hello eyad al akhras ,
Thanks a lot for the reply.
Actually in one of my thread, I have a dataGrid bounded with a daasource, so, my application is considering that databounded datagrid as an open active datareader. And at the same time another thread is executing SQL command. And sometimes, When another thread is executing SQL command, when I try to click Update (or SAve) button of a databinding navigator (for my datagridview) I get the same error saying "already datareader open.". Is there any snippet available to solve this problem either using mutext or something else. I have never used lock, mutex etc in my code, I dont know how to use those.
I am trying to implement a CSR(Coalition Service Registry). This is basically a registry where any service provider registers his/her service. Any service requesting user (initiator) contacts the CSR and the CSR forwards the request to the appropriate service provider and gets the result from it and forwards the result back to the initiator. I am implementing this in Visual Studio .NET C# language.
Generally in .NET to consume a web service we need to add a web reference to the client application. This leads us to use a static URL. But my implementation cannot afford doing this. So how would I approach it? To be more specific I need to implement the same functionality what "Add a Web reference" would do in .NET framework. Another issue I have is the invoking of the web service by the CSR should be transparent to the intitiator. Can anyone suggest a possible solution to this?Suggestions with a little detail of any libraries or classes existing in .NET which I could make use of is highly appreciated.
I'm beginner in these web services so my question may be very silly too sometime. Yeah I came across that option of changing the URL dynamically. But in that case if I'm right the service directory and service file should it be same? A sample code would help me a lot. And after this how will my CSR invoke the service and get the result and give it back to the requested client? I'm kinda confused in this part too.
Yeah I came across that option of changing the URL dynamically. But in that case if I'm right the service directory and service file should it be same? A sample code would help me a lot.
I did this a back while, but unfortunately the code was for an application built for another company, so I can't share any of that code.
The principle however, is simply to create the object for the proxy and then change the property for the URL. I don't remember the details, but I was able to find it quite easily, and you even know what to look for.
DotNet novice wrote:
And after this how will my CSR invoke the service and get the result and give it back to the requested client?
Once you changed the URL you use the proxy as normal. To get the result back to the client you just return it as usual (whether it's a web service or a web request).
I have a "test.cmh" help file that I compiled. Is there a way to restrict the use of the help file to be used only via an C# applications?. in other words, the CHM file will not run when user click on it.
Simply: No I don't think so unless you want to embed the help file as a resource and then extract it when you need but I'm not sure that this will work.
Another simple protection method would be to give it a different name without the .chm extension, for general users they wouldn't change the extension, but then again they probably wouldn't look for it.
Hey Guys, the windows application I use is in Persian, so when I enter to my form I gotta press SHIFT+ALT to change the language to persian from english, I'm looking for a code that does this for me !!! for example whe i load my form it authomatically chnages the language to persian and vise versa.