compactframework >> Arguement Exception

by chris-s » Mon, 18 Jul 2005 19:57:22 GMT

If you have used databinding's to link the combo box to the dataset,
then this cannot work since the item you are adding is not part of the
original dataset.

Either add the '*' item to the dataset or loop thru the rows in the
dataset manually adding them to the combo box items or create a
separate arraylist which you manuall add in the dataset rows plus the
'*' and then databind to this.

Chris


Similar Threads

1. Assembly.Loadfrom throws an Arguement Exception

2. Arguement Exception?? - VB.Net

3. problem with \r\n and \n (when passing multi line string arguement)

When I call a webmethod from my application, the enter 
code is encoded as "\r\n" (which is default, 
Environment.NewLine), when this string arguement is passed 
to the web method, the enter code becomes "\n". Problem 
with XML serialization, perhaps? Is there any attribute 
that I can set to prevent this conversion?

4. ReadOnly Properties - Arguements For/Against - Asp.Net

5. arguement for mshtml.IMarkupServicesParseGlobal

I am trying to call mshtml.IMarkupServicesParseGlobal

The signature in mshtml primary interopt is

  void ParseGlobal(ref mshtml._userHGLOBAL hglobalHTML, 
                            uint dwFlags, 
                            out mshtml.IMarkupContainer ppContainerResult, 
                            mshtml.IMarkupPointer pPointerStart, 
                            mshtml.IMarkupPointer pPointerFinish)

The first parameter is really a pointer to a string containing the HTML.  I 
have the HTML in a string but cannot figure out how to coerce it into an 
mshtml._userHGLOBAL  and so cant get a compile.  I have tried various 
variations on Marshal.StringToHGlobalAnsi() but these all return an InPtr 
which the compiler refuses to accept as a mshtml._userHGLOBAL 

Help appreciated







-- 
Charlie

6. How to return reference arguement using InvokeMember? - .Net Framework

7. Procedure has too many arguements specified

I've got a simple winform app that populates a datagrid on load.  There
are some text boxes on the form where users can add, delete or modify
the grid.  I'm using a data adapter to fill the grid and update the
database.  I've created stored procedures for select, insert, update,
and delete.

When I try to write data back to the database, I get the error
mentioned in the title.  I ran a trace with SQL profiler and it appears
my app is sending double the # of params I need.  Not sure how this is
happening.  Here's my code.

Insert sproc:

ALTER PROCEDURE [dbo].[usp_AddSignCon]
	@Account varchar(255) = '',
	@ReverseSign char(1) = 'Y',
	@ModifiedBy varchar(255) = 'System',
	@RuleStatus char(1) = 'Y'

AS
BEGIN
		SET NOCOUNT ON;

	INSERT INTO dbo.AddSignCon
	(Account, ReverseSign, ModifiedBy, RuleStatus)

	VALUES
	(@Account, @ReverseSign, @ModifiedBy, @RuleStatus)


Method to Update:

public void UpdateDataSetDA(DataSet dataSet, string sourceTable)

            {

            DA.InsertCommand=new SqlCommand();
            DA.InsertCommand.Connection=CN;
            DA.InsertCommand.CommandType = CommandType.StoredProcedure;
            DA.InsertCommand.CommandText = "dbo.usp_AddSignCon";
            DA.InsertCommand.Parameters.Clear();
            DA.InsertCommand.Parameters.Add(new
SqlParameter("@Account",
                SqlDbType.VarChar, 255, "Account"));
            DA.InsertCommand.Parameters.Add(new
SqlParameter("@ReverseSign",
                SqlDbType.Char, 1, "ReverseSign"));
            DA.InsertCommand.Parameters.Add(new
SqlParameter("@ModifiedBy",
                SqlDbType.VarChar, 255, "ModifiedBy"));
            DA.InsertCommand.Parameters.Add(new
SqlParameter("@RuleStatus",
                SqlDbType.Char, 1, "RuleStatus"));


            //Snipped code that updates and deletes

            DA.Update(dataSet.Tables[sourceTable]);
            }


It's bombing on the last line and like I saw with profiler, it appears
to be sending the parameters twice.  So I'm sending 8 instead of 4.
Here's my sample trace:

exec dbo.usp_AddSignCon
@Account='TestAccount',@ReverseSign='Y'@ModifiedBy='TestUser',@RuleStatus='Y',@Account='TestAccount',@ReverseSign='Y'@ModifiedBy='TestUser',@RuleStatus='Y'

Thanks in advance for any help

8. Getting Method Arguements from a Comma-Delimited Text File - CSharp/C#