.net

Missing HttpContext

Hi, I've got a project which as a reference added to System.Web. However, it can't seem to pick up HttpContext. Doing this: Imports System.Web _ApplicationBase = HttpContext.Current() Tells me that HttpContext is not declared. If you look at the methods and properties inside System.Web there are hardly any showing: only AspHostingPe...

System.Decimal rounds on assignment

can anyone explain why I am getting the following results? Dim badDecimal As Decimal = 54.50327999999999 Dim expectedDecimal As Decimal = CDec("54.50327999999999") badDecimal = 54.50328D, while expectedDecimal = 54.50327999999999D. My understanding is that badDecimal should contain the value of expectedDecimal (the fact that expected...

Interpreting WPF Dependency properties as a set.

So, I have a control. It displays an image based some xml document and an optional parameter "Document" - XML document "RenderingOption" - optional image-rendering ( sharpen, soften ) So: <XMLRenderingWidget Document="xxxxxx"/> The above will render the document once <XMLRenderingWidget Document="xxxxxx" RenderingOption="Sharpe...

What is a Managed Prototype?

I just need clarification on what a managed prototype is. I think it is a method that uses the DLLImport attribute and has a method like so: [DllImport("user32.dll")] private static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type); Does it always mean this i.e you must have a DLLImport attribute and ...

How to Store data without using Database and how to retrieve them ?

I am parsing the html file to extract tabular information through column names. And I want like let user give the input for column name. And according to that column names tabular information will be extracted. Now that column names which user will input,based on that column names I want to find the tabular information from the html fil...

Generate sound wave image from mp3/wav file?

Looking for a program / lib (preferably in .NET) that can take a sound file (mp3/wav/etc) and generate a sound wave image from it (similar to image below) ...

WCF .svc Accessible Over HTTP But Accessing WSDL Causes "Connection Was Reset"

I have a WCF service which is hosted on IIS6 on a Win2003 SP2 machine. The WCF service is hosting correctly and is visible over HTTP giving the usual "To test this service, you will need to create a client and use it to call the service" message. However accessing the .svc?WSDL link causes the connection to be reset. The server itself ...

.net converting bytearray to double[]

Hello, I am working with a database from a legacy app which stores 24 floating point values (doubles) as a byte array of length 192, so 8 bytes per value. This byte array is stored in a column of type image in a SQL Server 2005 database. In my .net app I need to read this byte array and convert it to a array of type Double[24]. I can a...

Login as SYS user to Oracle 11g from .NET

Using the Oracle Data Provider for .NET, my application connects to the database using the privileged SYS user. The connection string is as follows: Data Source=MyTnsName;User ID=sys;Password=MySysPassword;DBA Privilege=SYSDBA This works fine with Oracle 10, but Oracle 11 keeps complaining about an invalid username or password. I veri...

How to be sure a http request is local when using HttpListener

I'm using HttpListener. I want to only process requests however that come locally, not from another machine/server. How would I programmatically verify if an incoming request is local for sure? For example would it be using some of the HttpListenerRequest members? ...

How To find the location of any treeviewitem in silverlight

Hi I am new in silverlight 3. I want to find the location of any treeview Item . Although I applied this code GeneralTransform gt = ProjectTree.TransformToVisual(Application.Current.RootVisual as UIElement); Point offset = gt.Transform(new Point(0, 0)); double controlTop = offset.Y; double controlLeft = offset.X; Here Project tree is...

Problems in selecting a node in XML with Namespace using XPATH

I have the following XPATH line: //det[@nItem="1"]/prod/cProd That successfully selects the desired node using XPath Visualizer, where it identifies automatically the namespace, and you define in which namespace you want to select. When I specify the namespace in C# with the following XPATH code: "http://www.portalfiscal.inf.br/n...

How get file names using OpenFileDialog in .NET (1000+ file multiselect)

Maybe some of you have come across this before.... I am opening files for parsing. I'm using OpenFileDialog, of course, but i'm limited to a buffer of 2048 on the .FileNames string. Thus, I can only select a few hundred files. This is OK for most cases. However, fore example, I have in one case 1400 files to open. Do you know a way to ...

If I'm updating a DataRow, do I lock the entire DataTable or just the DataRow?

Suppose I'm accessing a DataTable from multiple threads. If I want to access a particular row, I suspect I need to lock that operation (I could be mistaken about this, but at least I know this way I'm safe): // this is a strongly-typed table OrdersRow row = null; lock (orderTable.Rows.SyncRoot) { row = orderTable.FindByOrderId(myOrd...

SAP .NET Connector

Hi all, I need to connect to SAP and do a simple update but it will be the first time for me connecting to SAP and i know almost nothing. After some search on web i learned that there is an API which works only in visual studio 2003 (SAP .NET Connector). But i have a win7 .net 3.5 sp1 system. Is there any free way to connect to SAP u...

CheckedState inconsisten in Treeview using Find Method

Hello, I'm using a Treeview control in a .NET 3.5 c# project and I'm noticing inconsistencies in the checked property when I use the find method of the Treeview control. I'll check some leaves (nodes with no children) and then click a button. Inside the button click I'm using the find method of the treeview control to locate the node an...

XmlDocument type not found even though I've referenced System.XML ?

I've referenced System.Xml: using System.Xml; Then in this line: XmlDocument xdoc = new XmlDocument(); I get: The type or namespace name 'XmlDocument' could not be found What could there possibly be wrong ? Info: .NET 3.5, C#, triple checked that it's referenced and used in the same document, been able to use similar and ...

Global access to MemoryStream

I want to serialize an object(Form) to the MemoryStream and ulteriorly be able to deserialize it. Is it possible to keep (read and write into) a global "memoryStreamContainer" when application is running? ...

How to use another type of EditingControl in a single .NET 3.5 DataGridView column ?

Is this possible to have two (or more) different kinds of cells to be displayed interchangeably in single column of C# .Net 3.5 WinForms DataGridView? I know one column has specified single EditingControl type, yet I think grid is flexible enough to do some tricks, I may think of only: Adding as many invisible columns to grid as requi...

.dll application name

Writing a .NET DLL how do I find Application.ProductName? EDIT: Obviously, importing Windows.Forms could solve the problem, but my DLL have nothing to do with Windows Forms. ...