argumentexception

Argument exception - parameter is not valid ( LinkLabel on WinForm )

Hi, I wrote a Win Forms app to test how a LinkLabel class works. It appears to be fine until I click on the changed LinkLabel. The Form1.cs code is below: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.For...

SPList Item get value - ArgumentException

Hi All, I have got a SPListItem and i have an array of column names. When i try to access the SPListItem values using the code below: for(int i=0;i<arrColName.length;i++) { string tempValue = item[arrColName[i]].ToString(); // Works fine in case the the specific column in the list item is not null // Argument exception - V...

C# - Regexp - ArgumentException

Hello, i want to match coordinates from a Browsergame. My Regex is: try { Regex r = new Regex("Mond ([1-9]) \x5B([1-9]):([1-9][0-9]{0,2}):([1-9][0-9]{0,2})\x5D"); Match m = r.Match("Mond 1 [1:1:1]"); } catch (ArgumentException ex) { Console.WriteLine(ex); ...

Why does FormatException not inherit from ArgumentException?

Is there a known reason why FormatException does not inherit from ArgumentException? An invalid format would seem to be a very specific case of an argument being invalid, similar to ArgumentOutOfRangeException. The MSDN article for the class states: FormatException is thrown when the format of an argument in a method invocation doe...

StrongNameKeyPair problem when attempting to use MoQ

Hi, I'm trying to create a mock HttpContextBase for unit test. var fakePrinciple = new GenericPrincipal( new GenericIdentity(userId), rolesList.ToArray()); var mockHttpContext = new Mock<HttpContextBase>(); mockHttpContext.Setup(t => t.User).Returns(fakePrinciple); HttpContextBase mockedContext = mock...

ArgumentException was unhandled Application.run

Hi I've been through many sites and can't seem to find an answer. I modified a view that was connected to a Datagridview connected through a tableadapter on a C# Winforms app and in order to "reconnect" I had to delete the tableadapter and reconnect it. This was to get rid of an error regarding Unique contstraints. So I fixed that and...

RegEx -- Quantifier {x,y} following nothing error

I am very new to RegEx -- so can someone please help me figure out what exactly is going wrong here? I have this code: string regPattern = "*[~#%&*{}/<>?|\"-]+*"; string replacement = ""; Regex regExPattern = new Regex(regPattern); Yet, when my app hits the regExPattern line, i get an ArgumentException -- Quantif...

ArgumentException on Image.FromStream when reading from Database

Ok, here is the thing. My program saves an image into a SQL Server Database, the column being of image type. When I try to recover it, I get an ArgumentException from the Imagen.FromStream method. The code that inserts the image is something like this: Bitmap img = (Bitmap)pictureBox.Image; MemoryStream m = new MemoryStream(); img.Save...

I get a Argumentexception by binding a customer to a WinForms Bindingsource

Hello, I'm learning NHibernate with Fluenthibernate. I'm using it with C#, Winforms and BindingSource, and I get a Argumentexception by loading a Customer without orders. What can I do or what is wrong? Mapping: public class CustomerMap : ClassMap<Customer> { public CustomerMap() { Id(x => x.Id); HasMany(x => x....

Empty Path Name Is Not Legal

So I'm trying to compile an Asteroids game. It's almost working, all the files are in place etc etc... The issue comes when it hits this code. FileStream myFileStream = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); string myTempFile = @"F:\Documents\Junior School\Computer Programming (Java 1)\AsteroidsWithSo...