Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Friday, March 23, 2012

Name of the column mapping UI control?

I am developing a transformation component and I'd like the gui to feature one of the mapping controls that are used for mapping input columns to, for example, SQL Server database columns in the OLE Database Destintation component, among others. I cannot for the life of me discover what the control is called or even whether it is available for general use. Can anyone help me out? Sorry if this is OT but it seemed like the people here would be the most likely to know immediatelly what I was on about.

Thanks
Charlie.

I am trying to do a similar thing and the tool you described would be useful for me too. Did you have any luck finding it?

Your help will be greatly appreciated,

Savita

|||No not at all. I ended up using a tree view to show the mapping and two list boxes, one for each side of the mapping. It doesn't look *great* but it works and besides, the mapping component I was talking about is pretty hellish to actually use if the mapping involves lots of lines that cross over. Even SSIS has two views on the same thing to make it look fancy and be clear.

Charlie|||As far as I know, and I have asked and looked, that control and much of the data flow UI controls are both undocumented and/or inaccessible. In fact I don't think the UI is managed at all, so would be rather nasty to try and use even if you could find and access it.

Name of the column mapping UI control?

I am developing a transformation component and I'd like the gui to feature one of the mapping controls that are used for mapping input columns to, for example, SQL Server database columns in the OLE Database Destintation component, among others. I cannot for the life of me discover what the control is called or even whether it is available for general use. Can anyone help me out? Sorry if this is OT but it seemed like the people here would be the most likely to know immediatelly what I was on about.

Thanks
Charlie.

I am trying to do a similar thing and the tool you described would be useful for me too. Did you have any luck finding it?

Your help will be greatly appreciated,

Savita

|||No not at all. I ended up using a tree view to show the mapping and two list boxes, one for each side of the mapping. It doesn't look *great* but it works and besides, the mapping component I was talking about is pretty hellish to actually use if the mapping involves lots of lines that cross over. Even SSIS has two views on the same thing to make it look fancy and be clear.

Charlie
|||As far as I know, and I have asked and looked, that control and much of the data flow UI controls are both undocumented and/or inaccessible. In fact I don't think the UI is managed at all, so would be rather nasty to try and use even if you could find and access it.

Name of the column mapping UI control?

I am developing a transformation component and I'd like the gui to feature one of the mapping controls that are used for mapping input columns to, for example, SQL Server database columns in the OLE Database Destintation component, among others. I cannot for the life of me discover what the control is called or even whether it is available for general use. Can anyone help me out? Sorry if this is OT but it seemed like the people here would be the most likely to know immediatelly what I was on about.

Thanks
Charlie.

I am trying to do a similar thing and the tool you described would be useful for me too. Did you have any luck finding it?

Your help will be greatly appreciated,

Savita

|||No not at all. I ended up using a tree view to show the mapping and two list boxes, one for each side of the mapping. It doesn't look *great* but it works and besides, the mapping component I was talking about is pretty hellish to actually use if the mapping involves lots of lines that cross over. Even SSIS has two views on the same thing to make it look fancy and be clear.

Charlie|||As far as I know, and I have asked and looked, that control and much of the data flow UI controls are both undocumented and/or inaccessible. In fact I don't think the UI is managed at all, so would be rather nasty to try and use even if you could find and access it.sql

Monday, February 20, 2012

my output parameter is being treated as an input parameter...why

I have a stored procedure which takes an input parm and is supposed to return an output parameter named NewRetVal. I have tested the proc from Query Analyzer and it works fine, however when I run the ASP code and do a quickwatch I see that the parm is being switched to an input parm instead of the output parm I have it defined as...any ideas why this is happening? The update portion works fine, it is the Delete proc that I am having the problems...

ASP Code...

<asp:SqlDataSourceID="SqlDS_Form"runat="server"ConnectionString="<%$ ConnectionStrings:PTNConnectionString %>"SelectCommand="PTN_sp_getFormDD"SelectCommandType="StoredProcedure"OldValuesParameterFormatString="original_{0}"UpdateCommand="PTN_sp_Form_Update"UpdateCommandType="StoredProcedure"OnUpdated="SqlDS_Form_Updated"OnUpdating="SqlDS_Form_Updating"DeleteCommand="PTN_sp_Form_Del"DeleteCommandType="StoredProcedure"OnDeleting="SqlDS_Form_Updating"OnDeleted="SqlDS_Form_Deleted">
<UpdateParameters><asp:ControlParameterControlID="GridView1"Name="DescID"PropertyName="SelectedValue"Type="Int32"/><asp:ControlParameterControlID="GridView1"Name="FormNum"PropertyName="SelectedValue"Type="String"/><asp:ParameterName="original_FormNum"Type="String"/><asp:ParameterDirection="InputOutput"size="25"Name="RetVal"Type="String"/></UpdateParameters>

<DeleteParameters>
<asp:ParameterName="original_FormNum"Type="String"/>
<asp:ParameterDirection="InputOutput"Size="1"Name="NewRetVal"Type="Int16"/>
</DeleteParameters>
</asp:SqlDataSource>

Code Behind:

protectedvoid SqlDS_Form_Deleted(object sender,SqlDataSourceStatusEventArgs e)
{
if (e.Exception ==null)
{ string strRetVal = (String)e.Command.Parameters["@.NewRetVal"].Value.ToString();
.....................

Stored Procedure:

CREATE PROCEDURE [dbo].[PTN_sp_Form_Del] (@.original_FormNumnvarchar(20), @.NewRetValINT OUTPUT )ASSET NOCOUNT ONSET TRANSACTION ISOLATION LEVEL READ UNCOMMITTEDDECLARE @.stoptransvarchar(5), @.AvailFoundint, @.AssignedFoundintSet @.stoptrans ='NO'/* ------- Search PART #1 ---------------- */SET @.AvailFound = (SELECTCOUNT(*)FROM dbo.AvailableNumberWHERE dbo.AvailableNumber.FormNum = @.original_FormNum )SET @.AssignedFound = (SELECTCOUNT(*)FROM dbo.AssignedNumberWHERE dbo.AssignedNumber.FormNum=@.original_FormNum )IF @.AvailFound > 0OR @.AssignedFound > 0/* It is ok if no rows found on available table, continue on to Assigned table, otherwise stop the deletion.*/--This means the delete can't happen.........BEGINIF @.AssignedFound > 0AND @.AvailFound = 0BEGINSET @.NewRetVal = 1ENDIF @.AssignedFound > 0AND @.AvailFound > 0BEGIN SET @.NewRetVal = 2ENDIF @.AssignedFound = 0AND @.AvailFound > 0BEGIN SET @.NewRetVal = 3ENDENDELSEBEGINDELETE FROM dbo.FormWHERE dbo.Form.FormNum=@.original_FormNumSET @.NewRetVal = 0--Successful deletionENDGO

------------------

When I go into the debug mode and do a quickwatch, the NewRetVal is showing as string input.

Not sure whether it will help, but try to set the Direction of NewRetVal to Output instead of IntputOutput:

<asp:ParameterDirection="Output"Size="1"Name="NewRetVal"Type="Int16"/>

You may also take a look at this article:

Input and Output Parameters, and Return Values

|||It could also be because the type doesn't match. A SQL int is 32-bits, and you've specified a 16-bit int.