.net-2.0

ExecuteScalar not functioning on server

The application uses Oracle DataAccess ver. 1.1. , VS 2008, .Net Framework 3.5 w/SP1 OracleConnection connection = new OracleConnection(ConnectionStringLogon); connection.Open(); OracleParameter selectParam = new OracleParameter(":applicationName", OracleDbType.Varchar2, 256); selectParam.Value = applicationName; ...

.NET 3.5 published in 11/07 .NET 3.0 in 11/06. Why are most people still using .NET 2.0?

People have been developing own solutions to the following problems: Consistent messaging frameworks for remote information exchange (webservices,rpc,...) SDK's for state managements for things such as Finite State Machines and Workflows Authentication Frameworks And much more. For over two years now, Microsoft offers .NET 3.0 whic...

Server Error in '/' Application.

I have created a Web Application in asp.net 2.0. which is working fine on my Local machine. However when trying to deploy it on sever that has windows 2003 sever, I get the error: Server Error in '/' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please rev...

Best way to encode text data for XML

I was looking for a generic method in .Net to encode a string for use in an Xml element or attribute, and was surprised when I didn't immediately find one. So, before I go too much further, could I just be missing the built-in function? Assuming for a moment that it really doesn't exist, I'm putting together my own generic EncodeForX...

Math.IEEERemainder returns negative results. Why?

The .net framework includes Math.IEEERemainder(x, y) in addition to the standard mod operator. What is this function really doing? I dont understand the negative numbers that this produces. Example: Math.IEEERemainder(0, 2) = 0 Math.IEEERemainder(1, 2) = 1 Math.IEEERemainder(2, 2) = 0 Math.IEEERemainder(3, 2) = -1 ...

Adjusting the auto-complete dropdown width on a textbox

I am using a textbox in a .NET 2 winforms app that is setup with a custom AutoCompleteSource. Is there anyway through code that I can increase the width of the list that appears containing the auto complete suggestions? Ideally I would like to do this without increasing the width of the textbox as I am short for space in the UI. ...

Read fixed width record from text file

I've got a text file full of records where each field in each record is a fixed width. My first approach would be to parse each record simply using string.Substring(). Is there a better way? For example, the format could be described as: <Field1(8)><Field2(16)><Field3(12)> And an example file with two records could look like: Som...

Same property, different types.

Let's say you have a class with a Uri property. Is there any way to get that property to accept both a string value and a Uri? How would you build it? I'd like to be able to do something like one of the following, but neither are supported (using VB, since it lets you specify type in the Set declaration for the 2nd one): Class MyClas...

C# preg_replace?

Hi, What is the PHP preg_replace in C#? I have an array of string that I would like to replace by an other array of string. Here is an example in PHP. How can I do something like that in C# without using .Replace("old","new"). $patterns[0] = '/=C0/'; $patterns[1] = '/=E9/'; $patterns[2] = '/=C9/'; $replacements[0] = 'à'; $replacemen...

ASPNET 2.0 Membership database

Hi, I have an application database and an aspnetdb database (generated from the ASP.Net 2.0 framework). I have restored both database from production onto my development environment but I am unable to log on with any of the users credentials that work on production. So my question is is there anything that ties the aspnetdb database ge...

How do I indicate a validation requirement to users of my class?

I'm implementing a class that wraps around an xml document with a very strictly defined schema. I don't control the schema. One of the properties in the class is for an element value that the schema indicates must match a certain regular expression. In the setter for the property, if a string doesn't match the expression I'm throwin...

How to add to a textbox the red line (like bad spelling in Word)?

How can we produce the effect of the red line under a bad spelling word like the image below : Update I do not want to use Google or whatever spell program. I would like to know how to create the effect of the red line. ...

.NET Open Source CODE for SFTP ?

I googled a lot, and could not find a single open source implementation of SFTP in .NET. All i got is 3rd party component for SFTP. can anyone help me with SFTP implenetation in .NET ? ...

C# Abstract class, using anonymous instead of declaring concrete class?

I have an abstract class and I would like to use it quickly by NOT create a concrete class that inherit the abstract class. Well, to define the abstract method anonymously. Something like that: Command c = new Command(myObject){ public override void Do() { } ...

Wait window in a windows application

I basically need to show a wait window to the user. For this i have put two seperate window forms in the application. the first form is the main form with a button. The second one is a empty one with just a label text. On click of the button in Form1 i do the below Form2 f = new Form2(); f.Show(); Thread.Sleep(2000); f.Close(); My id...

Event Handler behavioral difference .net 1.1 vs 2.0 with null delegate

Not sure what exactly is going on here, but seems like in .NET 1.1 an uninitialized event delegate can run without issues, but in .NET 2.0+ it causes a NullReferencException. Any ideas why. The code below will run fine without issues in 1.1, in 2.0 it gives a NullReferenceException. I'm curious why does it behave differently? What ch...

Creating controls within a Loop

I have have some code which adds new cells to a table and fills them with text boxes. The way I've coded it so far works fine: TableCell tCell1 = new TableCell(); TableCell tCell2 = new TableCell(); TableCell tCell3 = new TableCell(); TableCell tCell4 = new TableCell(); TableCell tCell5 = new Ta...

How do I fade a row out before postback

I have a table that is created in a DataList in ASP.Net. This table has three fields of text, then a field with an edit button, and a field with a delete button. When a person clicks the delete button, it posts back, deletes the items, and then binds the DataList again. The DataList is in an UpdatePanel so the item smoothly disappears af...

Is there any kind of file dependency tracer for Asp.Net apps?

I have an Asp.Net 2.0 (VB.Net) app and I'm trying to export a Control (ASCX) to another project. I need to know what other files that the Control needs in order to work. Is there any way - using VS.Net 2005 or an external app - to recursively trace the dependencies of a page or control in a solution? For example, for this file: ~/Cont...

How do I get and set Environment variables in C#?

How can I get Environnment variables and if something is missing, set the value? ...