.net

HttpWebRequest submit

Sorry for such popular question, but, i don't need fill anything, i just need press a submit button on html page, how can i do it, via HttpWebRequest? ...

Getting the connectionstring in .net 4

I want to get a connection string from the app.config file. connectionString = System.Configuration.ConfigurationSettings.AppSettings["DBEntities"]; But it doesnt work. It's empty. I cannot access the System.Configuration.ConfigurationManager because it's .net 4. How can i get my connection string from the app.config? Thanks ...

Calling unsafe code from managed (C#). Reading byte array.

Hello everyone, I have this method that I need to call and use in my application, but I don't know really know how to do it exactly. This is the function that I need to call. [DllImport(dll_Path)] public static extern int DTS_GetDataToBuffer(int Position, int Length, char* Buffer, int* DataRead); In my code, I have this function and...

Possible for SQL stored procedure to call .NET object?

Is it possible for a SQL Stored Procedure to call a .NET object? In my situation, I need to take a string parameter and return a hashed result that can be consumed by my secure client. I can either have this SP called on a per result basis (once per row), or I can possibly return multiple rows. It all depends on what SQL will support ...

When debugging unittest in visual studio the debugsession just quits

I've had this occur to me daily now. I am debugging my libraries using unittests. My libraries are all code projects inside a single solution. So I'm stepping through the code and all of a sudden it just continues as if I would've pressed F5, which I didn't. Is this a bug or is there something I'm missing here? Anyone else experiencing...

Deployment project: Read a setup variable from registry

I have a setup project in VisualStudio 2005. User is invited to fill-in the server address that will be stored in a registry key. Now, I would like that if the user reinstalls this project, that the old server name be proposed by default as value in the setup interface. Is is possible to keep the ancient registry key value, to propos...

Unable to cast COM Object - Exception

Hi everyone, Ive been trying to develop a COM Client application, but without success. My goal is to create an application that can open reports in Cognos Impromptu. Ive got Cognos Impromptu installed on this machine and im using Visual Studio 2008 to develop the client. I created my project as a consoleapplication in Visual Studio. Ne...

Is it possible to add a reference in a C# project depending on the value of a conditional compilation symbol (preprocessor constant)?

Hello, I am developing a library which can be compiled for two different technologies. Basically, the users of the library should be able to compile the solution either for the Unity3D game engine or the NeoAxis game engine. The problem is: while the library is ready for the conditional compilation (#if UNITY using ... #endif, etc.), I c...

Automating .NET Framework class references

Hello there! I'll have to generate a lot of externs so I can interface with the .NET framework from another programming language for an open-source project I'm working on. I was wondering if there is any way to get all the MSDN class references as an XML or something? I'm thinking about parsing the actual HTML, but it seems it won't be v...

Why native C++ Win32 DLL does not working properly in C++/CLI managed code?

Hello, I have native C++ DLL code to call from C++/CLI functions. It's not working properly. I am copying those areas of code here which causing problems. Note: I made native C++ stub and called that native dll's functions and it worked fine as per context. Native C++ DLL: void ExecutorFactory::GetTESService(string a_strFileToProce...

.Net Reflector not properly linking resources

Ive decompiled a library but when i try to run it, anything that requests something from the resource manager doesnt work properly leaving me with "{"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"Logistics.Products.LayerPicking.Properties.Resources.resources\" was correctly embedd...

POST'ing arrays in WebClient (C#/.net)

Hi guys, I've got a .net application that has a WebRequest that to a POST adds multiple times the same key, thus making it an array in the eyes of PHP, Java Servlets etc. I wanted to rewrite this to using WebClient, but if I call WebClient's QueryString.Add() with the same key multiple times, it just appends the new values, making a com...

SQL Server Error "Could not open a connection to SQL Server"

Hello. I know this is a known issue. But I've tried everything I found out and I can't solve it yet. I've a .Net winforms app. It needs to connect to a SQL Server in a remote server in the same network. It works perfectlly in my machine, but it doesn't in antoher machine from my work. Both machines have Windows 7 and installed the SQL s...

How to preserve whitespaces in attributes values when using XDocument?

I process xml which contains tabs ("\t") and line breaks ("\n") in its attributes values. When I parse it using XDocument.Parse(), the tabs and line breaks are converted to spaces, even with the LoadOptions.PreserveWhitespace parameter. How can I get a XDocument with original attributes values? ...

Passing null values in single line Conditional

Just a fictional code, but why this won't work? (as the date variable is nullable) DateTime? date = textBoxDate.Text != "" ? textBoxDate.Text : null; The error is "There is no explicit conversion between System.DateTime and <null> ...

I have applied printing functionality in pop up window. It is not working only in IE I am using .Net framework.

I have applied printing functionality in pop up window. It is not working only in IE I am using .Net framework. ...

How to cast 'object' to Class type on IComparer.Compare method

I'm implementing an int IComparer.Compare(object x, object y); from the IComparer interface. I know the objects are of type Class1, and I know one of its members is class1Instance.myDate, of type DateTime. What I want to do is something along the lines of: DateTime.Compare( (Class1)x.myDate, (Class1)y.myDate); But casting this w...

What is the purpose of debug/release configurations in Visual Studio 2008/2010 compiling to different folders?

What is the point of compiling assemblies to separate folders? At my work we have 50+ projects which live across a few different solutions. When projects are in the same solution you can set a Project Reference and it picks up the assembly in the \debug or \release folder accordingly. But when setting an external reference (via Browse...

How CompareTo method logic works in List sort function?

How CompareTo method logic works in List sort function. public class person : IComparable { string firstName; string lastName; public int CompareTo(object obj) { person otherPerson = (person)obj; if (this.lastName != otherPerson.lastName) return this.lastName.CompareTo(otherPerson.lastName); ...

Windows Phone 7 not reading dutch localization strings

I am trying to localize an app in Dutch, but the emulator doesn't seem to pick up and recognize the Dutch versions of my resource strings. I have a base Strings.resx file with the english translations. Then, I have Strings.nl.resx with the Dutch translations. I also have Strings.es.resx, Strings.fr.resx, and Strings.it.resx. When I cha...