.net

Creating a SOAP Header with WS-Addressing and WS-Security from scratch

I am sending out a SOAP message from a windows service to an http endpoint (regular aspx page that will just accept the whole SOAP envelope). The overall operation is async, the actual response comes back at a later time. The nature of the setup (aspx page receiving message) means I cannot have a service reference in my project. The SOA...

Token access to sharepoint Web service

Here is my problem, I have one webpart that will retrieve current username and its token, using this code: SPUser myUser = SPControl.GetContextWeb(Context).CurrentUser; This information will be forwarded to external system, that will invoke windows service to download a document in sharepoint using sharepoint webservice. The probl...

.Net Web Reference SSL Error

While using a Visual Studio "Web Reference" to a SOAP service on a server that requires an HTTPS connection I get the error: "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." The parent class of the client is SoapHTTPClientProtocol if that makes any difference. I am not in t...

How do I run an if statement in aspx?

I would like to run an if statement but the condition uses a variable from the code behind. How do I call that variable? Side note... I am using a gridview and the variable is in a dataset (dsResult - idnbr colum) <ItemTemplate> <% string temp = (Eval("idnbr").ToString()); if (temp.Contains("X")) { %> ...

Wrong path returned by Environment.GetFolderPath(Environment.SpecialFolder.ApplicationFolder) under IIS6 WebService

On my test machine running (Windows XP, IIS5.1) the following code executed within a C# .NET WebService (.SVC) under a custom process identity (using machine.config to specify the user) Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); correctly returns c:\Documents and Settings\myUserName\Application Data Howev...

Multiline Textbox Column in DataGridView

I want to have a multiline textbox to display data in a DataGridView. I found a solution here but that is not working for me. Here is my code that I am trying to fix the problem with: myDataGridView.Columns["Column1"].DefaultCellStyle.WrapMode = DataGridViewTriState.True; I noticed that I can scroll inside of the textboxes, but their h...

Should Lotus Notes Client be running or Open in background to send emails programatically using .NET through Lotus Notes Client?

Hi Does Lotus notes client be running or opened in the background to send emails using Lotus Notes with .Net? I am working on a task where my .net application should send emails using Lotus Notes client ( NOT SMTP) with .NET using Dominos.dll. I am able to send mails also. But the problem comes when i close my Lotus Notes mail client ...

Deserializing an an array element

I have something like the following xml that I need to deserialize (note I cannot change the XML): <Root> <Products> <Product>1</Product> <Product>2</Product> <Product>3</Product> </Products> </Root> Here is how I am trying to deserialize it: [XmlRoot("Root")] public class ProductsResponse { [XmlEleme...

Which isolation level to use to prevent data from being read?

I have situation like this. Query is like this. Select * from TABLE where ID = 1 (what a query :) after that I change stuff in that row and INSERT it with new id. I want to prevent other qeueries to read that first original row from query, untill I finish the read and insert. After that..go ahead. Basicly I want select and insert...

why no output when use command line to build VS setup project?

I have installed Visual Studio 2008 on our build machine because we want to build the setup project to create MSI installer for our C# application. From IDE, it works fine. The installer is created as expected. Switch to command line, with the follow command the process finished without any error but there is no output (no installer c...

WebRequest to PUT file on SharePoint server returns (405) Method Not Allowed

I have a sharepoint server on which some files are hosted. I have some .Net code that creates a WebRequest to GET some of the files. This is is working correctly. When I try to use similar code to PUT a file at the same location, I'm getting a: System.Net.WebException: The remote server returned an error: (405) Method Not Allowed o...

Best practice: How to detect if a SQL Server is available and failover if not

Hi there, I am looking for a way to detect if a SQL Server fails to respond (timeout/exceptions etc) so that if our C#/.net program trying to access the server asks a server that is down for maintenance, it will jump and try another automatically. I would like a solution where we do the SQL connection and THEN get the timeout. We could ...

obfuscate the codes in .net

Possible Duplicate: Help me choose .net obfuscator program ? i write my project .now i want to obfuscate all my codes. how can i do this issue? thanks in advance. ...

Structure Map Profiles and Adding Instances

Structure map (2.6). I have some classes and a registry that look like the following: public interface IManyType {} public class ManyType1 : IManyType {} public class ManyType2 : IManyType {} public class ManyType3 : IManyType {} public class TestRegistry : Registry { public TestRegistry() { For<IManyTy...

Service contract and variable names

Hi, I have WCF service. I have changed the name of the variable in datacontract, rebuilt service but did not rebuilt client Before, this is operation contract for client [OperationContract(Name = "SubscribeWcfProvider")] bool Subscribe(Guid subscriptionid); After, this is operation contract for service [OperationContract(Name = "S...

Does DataWindow .NET use connection pooling?

Does or can DataWindow .NET take advantage of connection pooling? ...

MySQL with Entity Framework - what am I doing wrong?

...

Deriving from SynchonizationContext, comments appreciated

Hi, In short, I've implemented a class that derives from SynchronizationContext to make it easy for GUI applications to consume events raised on threads other than the GUI thread. I'd very much appreciate comments on my implementation. Specifically, is there anything you would recommend against or that might cause problems that I haven'...

Simple auto updater for OpenVPN config files

Hi, We have deployed several OpenVPN servers globally and our 8k+ Windows users have OpenVPN GUI installed. Each server is defined in a config file in the program files directory. As we add new servers to the network (we require almost a dozen globally) we would like a slick solution to auto update the config directory with the new conf...

How do I force the auto-generated WSDL on two load-balanced machines to match?

We have a WCF service that is deployed to two servers. The bits are exactly the same. In the auto-generated WSDL at https://mywebsite.com/SomeService/Soap.svc?wsdl, the <wsdl:types> node lists out a bunch of XSD's, in this format: <xsd:import schemaLocation="https://mywebsite.com/SomeService/Soap.svc?xsd=xsd0" namespace="http://service...