|
If you use a data reader to read the result from the command, the connection is in use until you have closed the data reader. If you want to reuse the connection in a loop, you have to read the result and close the data reader inside the loop.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
yes im using a data reader
do u mean i have to do like this
while dtr.read()
{
do something
dtr.close
}
|
|
|
|
|
Yes, with the small modification that you close the data reader outside the loop that is using it.
As long as the data reader is open, you can't reuse the connection.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
You don't have to worry about that. In .NET connection pooling is turned on by default. Even if you call the Close() method, the runtime leaves it open just in case it will need to be used again.
|
|
|
|
|
my problem is i dont want to do a lot of connections to the database. i just want to open the connection once and then close it once im done with everything
|
|
|
|
|
Hi
I've a WindowsFormsApplication project and I wish to use Office components in it.
For example, Consider the PlainTextContentControl which belongs to Microsoft.Office.Tools.Word namespace. (i.e. As we know this component is in the "Word Controls" group of ToolBox.) I added the above reference to my project, but this component is not accessible yet.
Thanks
|
|
|
|
|
Pardon me if this is not the correct place to ask following question.
In visual studion I guess there are two ways to create a web application
1st : File -> New -> Web Site
and
2nd : File -> New -> Project -> Visual C# -> ASP.Net Web Application
I wonder what is the difference between the two. I found one, when I add crystal report file to fist one I can not see the .cs file for the same.
Please guide
|
|
|
|
|
|
Generally from what I remember the Web Site is similar to the stuff which Visual Web Developer creates, it's more suited to compiling on the fly (just dump the .aspx and .cs files and when they're first requested ASP.NET compiles them). In a Web Application things tend to be compiled and then deployed (minus the source, although that's not a requirement), the major difference is that a web application looks on the file system more like a normal solution (i.e. a solution file, project files etc, whereas the web site is dumped all over the place usually).
The general preference is to use a web application not a website.
|
|
|
|
|
Hello everyone,
For some non-technical reasons, I can not change the web services implementation code at server side, but only the generated WSDL. Now I want to manipulate the WSDL of the web services to let it require client (web services consumer) to send some additional SOAP headers in each request.
My question is any reference documents about how to manipulate the WSDL so that each time when client is using the WSDL to generate the proxy, it could already have the data structures and other handy things in the proxy so that it is very convenient for the client to send request including the new SOAP headers. Any referred document to do this?
thanks in advance,
George
|
|
|
|
|
It sounds like something you could do with Web Services Enhancements[^] - well...you could take a similar approach or just use WSE directly.
The problem is that your clients could end up adding the headers, but the web service won't understand them or even see them. Of course, if you have some intermediary that uses the headers then WSE is the way to go since you can add routing information and other stuff to the SOAP header.
There have been a number of revisions to WSE, so you need to make sure you're using the right version for your development platform. I believe WSE is also part of WCF, but I have not researched that to know for sure.
Erik Westermann - wWorkflow.net - BizTalk Consulting Services
SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
wWorkflow.net or +1 416-809-1453
|
|
|
|
|
Thanks Erik,
I read the article for an hour. But it never covers how to add a SOAP header for an input WSDL. It majorly covers security, TCP messaging and addressing.
My purpose is for an input WSDL file, I can add some required SOAP header for some web methods. Any comments or ideas?
regards,
George
|
|
|
|
|
My reply was a little vague, but I did say you could so something like WSE does, or just use WSE directly.
I was thinking of WSE to add SOAP headers since you could just create a WS that mocks/mimics the WSDL in the file you have, then implement the service using empty methods or whatever, and finally use WSE to add the headers you want (I'm assuming that you want to add WSE headers since it sounds like you may want to route the request, or add credentials - this is exactly what WSE is for).
It is a round-about approach, but you end up with headers that are correct. Once you have them, use disco.exe to grab the WSDL (among other files) and you're set.
The alternate approach is to familiarize yourself with WSDL[^] and SOAP[^] - because WSDL includes SOAP - and manually edit your WSDL.
Personally, I think WSDL and SOAP are not meant for developers to read and edit directly, which is why I suggested the WSE route so that you could automatically generate the headers and resulting files, knowing that they are compliant with the underlying standards.
Erik Westermann - wWorkflow.net - BizTalk Consulting Services
SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
wWorkflow.net or +1 416-809-1453
|
|
|
|
|
Hi Erik,
I have read the article you recommened to me carefully. I think WSE only adds SOAP headers which is security related to support some special security protocols, not arbitrary SOAP header.
If I am wrong, please feel free to correct me and let me know which API from WSE could add arbitrary SOAP header. Thanks.
regards,
George
|
|
|
|
|
Try this article[^]. The article explains how to add an arbitrary header to a SOAP message, and then use WSDL.EXe to generate the WSDL file.
So, here's how you could do it:
Option A:
Familiarize yourself with WSDL[^]/ and SOAP[^] - because WSDL includes SOAP - and manually edit your WSDL.
Option B:
Use the .NET framework to generate a new WSDL using the approach here http://blogs.tamtam.nl/paulb/2007/10/09/AddingCustomHeadersToASOAPMessagePart1.aspx[^] and then take the parts you want from your new file and copy them to your existing file.
I hope that clarifies it and wish you good luck!
Erik Westermann - wWorkflow.net - BizTalk Consulting Services
SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
wWorkflow.net or +1 416-809-1453
|
|
|
|
|
Thanks Erik,
1.
I have read the article, and it need to modify the source codes of web services code -- please feel free to correct me if I am wrong.
But my purpose is not to modify the web services code, and only modify the generated WSDL code. So, I think the code in the article does not help too much.
2.
For the WSDL and SOAP spec, they are really good, accurate and complete. But long...
Do you have any tutorials which are easy to learn the major concepts of WSDL and SOAP which is enough for me to complete my work -- add SOAP header?
regards,
George
|
|
|
|
|
George_George wrote: ...they are really good, accurate and complete. But long...
Yes they are - that's so you can learn about SOAP and WSDL.
George_George wrote: Do you have any tutorials which are easy...
No - you either learn it on your own or get someone to do it for you. And...I'm not the guy to do that for you - my rates are too high
Erik Westermann - wWorkflow.net - BizTalk Consulting Services
SOA * ESB * BPI * SaaS ... forget the alphabet soup - get the main course with our consulting services!
wWorkflow.net or +1 416-809-1453
|
|
|
|
|
Hi Erik,
I am looking for some samples which is doing similar work as I did -- e.g. adding SOAP header for some input WSDL file. But failed to find any ones very helpful.
Do you have any recommendations?
regards,
George
|
|
|
|
|
hai
i m a vb.net programmer from 2 yrs,just from 3 days i m doing a project in c#
a small doubt , which i should not ask...
here it is
in vb.net
Public sub Display()
exit sub
end sub
the same code how to write in c#
my problem is with exit sub
how to exit from a button click event or procedure or function in c#
plz dont mind ... give reply
thank u
bye
vijay kumar d
|
|
|
|
|
public void Display()
{
return;
}
Although you don't need the return in this case, here it'll return automatically when it's in a codepath that has no instructions left in this method.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
<br />
public void Display<br />
{<br />
<br />
}<br />
would be its equivalent.
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
in short, if your method returns void, you shouldn't exit, it will exit after automatically after }.
When you return something (object, integer, ...) you should return that type.
private void MethodNoReturn(){
}
or
private string MethodReturnString(){
return a_string;
}
hope this helps...
|
|
|
|
|
What about a C# tutorial?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
In the explore window if I sort some files descending I get the following...
<br />
file 19<br />
file 20<br />
file 21<br />
file 186<br />
file 187<br />
file 189<br />
If I use Directory.GetFiles() it retrieves the files in this order
<br />
file 186<br />
file 187<br />
file 189<br />
file 19<br />
file 20<br />
file 21<br />
Is there an easy way for me to get files in the same order as a descending rearrangement in explorer?
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Sort the array you get from GetFiles() . You can do this via Array.Sort() .
regards
modified 12-Sep-18 21:01pm.
|
|
|
|