Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Thursday, March 22, 2012

Error in variable mapping in Execute SQL Task

Hi,

I am getting an error message (mentioned below) in the variable mapping of Execute SQL Task in SSIS.

" Error: ForEach Variable Mapping number 9 to variable "User::Value" cannot be applied. "

" Error: The type of the value being assigned to variable "User::Value" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. "

Pls anyone have a look and give me a solution asap.

Thanks & Regards,

Prakash Srinivasan.

What was the type of the variable "User::Value" and what the was the value that you were trying to assign to this variable?|||

Hi,

Thanks for your response. I was trying to pass the float value and declared the variable as double only. But yesterday I deleted all the variable mappings and did the same mapping again, the problem got resolved.

I don't know what was the problem, even I re-assigned the same index values (starts with zero) for all the variables in the Foreach ADO Enumerator.

Anyway the problem got solved.

Thanks & Regards,

Prakash Srinivasan.

|||

Hi,

I'm seeing the same problem with one package I have put together. I have an "int" variable from a select statement. That variable is mapped to an int32 variable in the package. When I try and foreach through the data set (from previoeus Execute SQL task), it bombs and I get the same error. Error: ForEach Variable Mapping number 1 to variable "User::variablename" cannot be applied. Then in the PostExecute I get the following error: Error: The type of the value being assigned to variable "User::variablename" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.

Seems to me there must be a bug here that only gets triggered when you create the mapping with the incorrect data type, fix it, and then try again. For some reason, even though you have fixed it, it believes the data types are still the old ones. MS, if you are interested in a package that displays this behavior, then email me.

dcb99

|||

All,

Ok. Figured this out for my case. The problem is the foreach will not allow a NULL to be assigned to an int32 variable. Seems like SSIS should have nullable types built into it. Anyway, when I replace the column in my select statement with an ISNULL(columnname, 0) then it works fine. Too bad the error want something like: "Data is out of range for this variable type. Please adjust data or use aa different variable type."

dcb99

Monday, March 19, 2012

error in searching records

Hi

I am developing windows application.

I want to find records which has a particular number which is entered in textbox.
and result is displayed in datagrid.

If the entered number didnt find in database it must be displayed msg.

i tried it like as below but not working.

qlConnection conn = new SqlConnection();
conn.ConnectionString = "Server=EBSERVER;UID=sa;Database=Airport-Clearance;";
//SqlConnection sqlconn = objcs.GetConnection();
//MessageBox.Show("Connected");
//sqlconn.Open();
//Do what ever

SqlDataAdapter filling = new SqlDataAdapter("select * from Airport where awb='" + txtawb.Text ,conn);

DataSet displaying = new DataSet();

conn.Open();
filling.Fill(displaying);
dataGrid1.DataSource = displaying.DefaultViewManager;
conn.Close();

Waiting for reply.

Warmest regards,
ASIF

can you explain what "not working" is? Does it throw any errors? or does it not return anything?

What is the datatype of your "awb" column in the airport table?

Wednesday, March 7, 2012

Error in Executing Bulk Load using SQLXML 4.0

I have a number of apps which do xml bulk load using sqlxml 4.0. But, in on
e
program when I attempt to execute the following
SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class bulkLoadObject = new
SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();
I get this error raised.
"Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class'
to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation faile
d
because the QueryInterface call on the COM component for the interface with
IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE))."
While in another app the same statement executes with no problems.
I have no compile errors in the offending program. I have dropped the
reference and re-added a couple of times.
Does anyone have any insight?Could this be something related to the interop DLL in the GAC? What
happens when you refresh it?|||All the other apps that use SQLXML 4.0 bulk load on that machine have no
problems.|||Hello,
This is usually due to the fact that you are missing [STAThread] declaration
like in:
[STAThread]
static void Main()
Hope this helps,
Monica Frintu
"AlanS" wrote:

> I have a number of apps which do xml bulk load using sqlxml 4.0. But, in
one
> program when I attempt to execute the following
> SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class bulkLoadObject = new
> SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class();
> I get this error raised.
> "Unable to cast COM object of type 'SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class
'
> to interface type 'SQLXMLBULKLOADLib.ISQLXMLBulkLoad4'. This operation fai
led
> because the QueryInterface call on the COM component for the interface wit
h
> IID '{88465BA7-AEEE-49A1-9499-4416287A0160}' failed due to the following
> error: No such interface supported (Exception from HRESULT: 0x80004002
> (E_NOINTERFACE))."
> While in another app the same statement executes with no problems.
> I have no compile errors in the offending program. I have dropped the
> reference and re-added a couple of times.
> Does anyone have any insight?