|
Events are alwyas "2 way", though they are never described as such.
There is always an event provider and one or more subscribers to that event. The event usually passes the source of the event (usually as Object) and some kind of EventArgs object. What you may not realize is that you can modify the Eventargs object passed to your event handler. When the event handler code goes out of scope, the event provider gets control back and can look at the data that is in the EventArgs object it sent to the handler. For an example of this, see Form_Closing and it's FormClosingEventArgs class. In there, you'll find a Cancel property that the handler code can set to cancel the form being closed.
Another example is KeyPressEventArgs and its Handled property.
|
|
|
|
|
Just what I was looking for. thx
|
|
|
|
|
I have a C# 2010 console/desktop application that obtains its own database connections from its app.config file. This application adds a reference to a dll so that it can access another C# console/windows application.
The main C# 2010 console/desktop application needs to be able to access the database connections of the program that is called in the dll. The database connections of the called program are stored in an app.config file.
Thus can you show me code or explain to me how the main C# 2010 console/desktop application can obtain the database connections stored in the app.config file for the program that is accessed by the dll?
|
|
|
|
|
|
Hi ,
Could you please let me know how to pass a boolean value to an oracle parameter ?. When I googled I found that boolean data type is not supported in .net
With Regards
|
|
|
|
|
|
which is not there in 'OracleType' structure
|
|
|
|
|
Subin Mavunkal wrote: 'OracleType' structure
What exactly does that have to do with .NET supporting Boolean data types?
|
|
|
|
|
I want to pass a boolean value to an oracle parameter .My doubt is how to create .net oracle parameter for a boolean data type and pass that value. Even entity framework is not supported for stored procedures with boolean parameters
|
|
|
|
|
|
That is not the case. SPs are already written and unfortunately we can not change it This is the issue
The function 'SP_GBM_AUDIT_FIELD_ENTRY' has a parameter 'BCHECK' at parameter index 5 that has a data type 'pl/sql boolean' which is currently not supported for the target .NET Framework version
|
|
|
|
|
Or at least most flavors don't. Usually dba's will use Char(1) Y or N to indicate boolean. I have seen quite a lot of difference. Find what ever your DB is using and pass it in:
Code:
if(value== true)
parameter = "Y"
else if(value==false)
paramter = "N"
else
parameter = "FileNotFound"
|
|
|
|
|
I have created a gridview to display the database in the ASP.NET application. I have formed a dropdown box to which data is bounded.
I want to see the data displayed in the boxes as I select a name field from the drop down box.
Please tell me how to do this.
P.S.-I am a Beginner.
|
|
|
|
|
I have created WCF Rest Service Application using Visual 2010 an year ago. Now I need to use DBGeometry class in the service. But the Rest Service throws an exception (Bad Request) when I use DBGeometry. So I want to create a new WCF Rest Service application using visual studio 2012. Unfortunately there is no WCF Rest Service Application template in Visual Studio. I tried to create WCF Rest Service Application using Blank Solution in Visual Stdio 2012 , but could not get to work. Is there any template or any other ways to create WCF Rest service app in Visual studio 2012.
I know I can use ASP.Net MVC 4 and Web API template... but it's too much work, since I need to create controllers , etc for all my Rest service methods...
Thanks.
|
|
|
|
|
|
|
i want to upload a file to ftp server using simple C# widows service application, and this is my code
protected void UploadToFTP(string path, string name)
{
string strLocation = string.Format(ftpfullpath + "/{0}.txt", strNewFtpName);
// FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create("ftp://192.168.10.239/test.txt");
FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(strLocation);
ftp.Credentials = new NetworkCredential(strFtpUsername, StrftpPassowrd);
ftp.KeepAlive = true;
ftp.UseBinary = true;
ftp.Method = WebRequestMethods.Ftp.UploadFile;
FileStream fs = File.OpenRead(source);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Stream ftpstream = ftp.GetRequestStream();
ftpstream.Write(buffer, 0, buffer.Length);
ftpstream.Close();
}
when i test this application .txt file is created in FTP server.
But when i run a window service the .txt file is not created(uploaded) on FTP server. How do i solve this??
|
|
|
|
|
You should add some trace code so that you can see what happens when running as a service.
Use the best guess
|
|
|
|
|
Windows service is running successfully.
i have also logged the messages step by step.
It tells File uploaded successfully with its respective file name.
But file not created on FTP server.
|
|
|
|
|
susanna.floora wrote: It tells File uploaded successfully with its respective file name. But you are not checking the FTP response so you cannot be sure of that.
Use the best guess
|
|
|
|
|
What happens when you run that service under your account instead of Local System or Network System?
|
|
|
|
|
I tried the same code, the same procedure in different machine.. it works fine..
But why not it works in my system?
|
|
|
|
|
Hi,
I am suffering a bug in VS 2012R2, and reported same.(Builds fail before they start, citing an internal error.) In response I was invited to supply further info, such as a stack dump using a Bug Reporting Tool. for which MS provided a link. I downloaded a File:"Quote: Microsoft.VisualStudio.FeedbackTool.vsix
How do I integrate this with the IDE. The MS instructions are to install it by downloading it. It intimates that after downloading, it should appear on the bottom ribbon, (which it does not), and can be invoked from the 'Help\Report Bug' menu. That's also not the case!
Where do I go from here!
Bram van Kampen
modified 25-Jun-13 20:20pm.
|
|
|
|
|
|
Hello,
I want to create a windows service that will act as a connection pool manager for a 3rd party tool to various apps (web, utilities, etc) that are running on same server. I'm struggling with how the other apps call this service without creating additional instances of the exe. I've played with load assembly and references and it seemingly is creating an additional instance.
Proof: I have a static class that is populated (initialized) upon load of the service. When an app tries to create an instance of a different class that calls methods within the static class...the static class is empty (uninitialized). So my conclusuion is a second instance is created?
How can I design this to do what I'm looking for...
Thank you for your time...
Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
|
|
|
|