.net

How to get the Exception information from Marshal.GetExceptionCode();

When using Marshal.GetExceptionCode() how do you get the Exception Type and/or instance of the exception? http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.getexceptioncode%28VS.71%29.aspx ...

Connecting to Oracle 10g from .NET

I am trying to connect to oracle server located at some IP address but always get error as System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception. ---> Oracle.DataAccess.Client.OracleException The provider is not compatible with the version of Oracle cl...

Is the IP from the source or target in this System.Net.Sockets.SocketException?

I'm making an outbound connection using a DNS name to a server other than the localhost, and I get this exception: System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:5555 The text implies that the T...

Image display incorrect on toolstrip

I use a 32-bit image & use it as a value for Image property of ToolStripButton. But I don't know why it displays unlike the original one. This is the screenshot: And my project: http://www.mediafire.com/?3mzmf5r5nnx Please help me to find the reason. Thanks. ...

.NET Compact Framework Form not closing properly

I have a form in a Compact Framework application. When the user presses the 'X' or 'OK' button in the top right, the screen doesn't refresh until the users taps anywhere on the screen. The form is being shown using this code: using (var customerDetailsForm = ObjectFactory.Get<CustomerDetailsForm>()) { customerDetailsForm.AssignCust...

Should i dispose a stringwriter? or reuse somehow?

I'll make it simple. I have a stringwriter as a class member therefore i cannot use using(). I want an empty sw everytime i call a certain function. Should i call Dispose() on the sw and allocate a new object? or should i do something like .close() and do something else to empty the buffer? ...

how to copy database files from the network access server to Client PC in .net?

im using a code to copy the files from the database of server PC. so im accessing that server PC through IP address but it is giving me error and not copying the files in the folder of my PC (client PC) this is my code that im using...can u tell me where im wrong?? the file path is given on my listview in winform.. public string Record...

How to create dynamic tables/fields in asp.net similar to phpMyAdmin

I just wanna ask if there's a way in C#/ASP.NET to create 'dynamic' tables/fields similar to phpMyAdmin: Any suggestions/comments? ...

What is the difference between this initialization methods?

Hi all What is the difference between this two codes? class SomeClass { SomeType val = new SomeType(); } and class SomeClass { SomeType val; SomeClass() { val = new SomeType(); } } Which method is preferd? ...

sending outlook meeting request through asp.net application

Can anyone please send me the code to sending meeting request through .net web application? ...

Web request timeout in .NET

I am trying to make a web service request call to a third part web site who's server is a little unreliable. Is there a way I can set a timeout on a request to this site? Something like this pseudo code: try // for 1 minute { // Make web request here using (WebClient client new WebClient()) //...etc. } catch { } ...

Does Socket.Bind be necessary for every situation about Socket programming?

Does Socket.Bind be necessary for every situation? If no, what are the situation in which Socket.Bind must be used? Any help? Thanks. ...

Inheritance issue

hi Friends i am facing a issue in Inheritance i have a interface called Irewhizz interface irewhzz { void object save(object obj); void object getdata(object obj); } i write definition in different class like public user:irewhzz { public object save(object obj); { ....... } public object getdata(object obj); { ...

How to mark a method as "ignore all handled exception" + "step through"? Even when user has selected "break on all thrown exceptions".

I want to mark a method as "debug step through" even if an exception is thrown (and catched within) the function. This is because 99% of the times I know this function will throw an exception (Assembly.GetTypes), and since this function is in a library I wish to hide this normal exception. (Why did MS not add an exceptionless GetTypes()...

App.config vs. .ini files

I'm reviewing a .NET project, and I came across some pretty heavy usage of .ini files for configuration. I would much prefer to use app.config files instead, but before I jump in and make an issue out of this with the devs, I wonder if there are any valid reasons to favor .ini files over app.config? ...

IQueryable IGrouping how to work

i return such type IQueryable< IGrouping<int, Invoice>> List() how can i work with it? like with generic List<Invoice> ? ...

Pipe ffmpeg to oggenc(2) with .NET

I am trying to encode ogg files at -q 6/192k. ffmpeg doesnt seem to be listenting to my command ffmpeg -i blah -acodec vorbis -ab 192k -y out.ogg So i would like to use the recommended ogg encoder. It says the input must be wav or similar. I would like to pipe a wav from ffmpeg to ogg. However not only am i unsure if oggenc2 will acc...

How to show only border of winforms window when resizing?

I would like to disable displaying of the content of the window when resizing, is it possible? The problem is that when I'm resizing my window the controls redraw on correct positions but it doesn't look good because it's not done fluently. EDIT: I would like a code that would manage the following scenario: I click on the corner of ...

How to make 2 incompatible types, but with the same members, interchangeable?

Yesterday 2 of the guys on our team came to me with an uncommon problem. We are using a third-party component in one of our winforms applications. All the code has already been written against it. They then wanted to incorporate another third-party component, by the same vender, into our application. To their delight they found that the ...

CodeDOM: Adding DebuggerStepThroughAttribute to property

I know how to add a DebuggerStepThroughAttribute to a method or a constructor, usually you add it to the CustomAttributes collection of a code member. But I don't see a way to do this for the setter and getter of a C# property, because neither of them provides this collection where you add the attributes. Does anyone have a clue? ...