command parameters

Discussion in 'ASP.NET / ASP.NET Core' started by raj, Nov 30, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. raj

    raj

    cmd = new OleDbCommand();








    SqlStr+= "INSERT INTO suspended_event([group_name], [orig_event], [version], [event_type], [service_id], [channel_name], [database_id], [org_id], [site_code], [user_id], [xml_data], [event_status], [error_text], [msgs_code], [responsibility_id], [row_added_ts], [csi_logicalid], [csi_component], [csi_task], [csi_referenceid], [csi_confirmation], [csi_authorizationid], [csi_creationdatetime], [csi_bodid], [csi_responsibility_id], [csi_portreference], [atch_set_id], [business_entity_id], [event_desc], [build_nbr], [successful_cnt], [failed_cnt], [not_processed_cnt], [corrected_cnt]) ";


    SqlStr+= "Values( @group_name, @orig_event, @version, @event_type, @service_id, @channel_name, @database_id, @org_id, @site_code, @user_id, @xml_data, @event_status, @error_text, @msgs_code, @responsibility_id, @row_added_ts, @csi_logicalid, @csi_component, @csi_task, @csi_referenceid, @csi_confirmation, @csi_authorizationid, @csi_creationdatetime, @csi_bodid, @csi_responsibility_id, @csi_portreference, @atch_set_id, @business_entity_id, @event_desc, @build_nbr, @successful_cnt, @failed_cnt, @not_processed_cnt, @corrected_cnt)";


    cmd.Parameters.Clear();


    cmd.Transaction = tran;





    cmd.Parameters.Add("@group_name",OleDbType.VarChar,32).Value = GroupName;


    cmd.Parameters.Add("@orig_event",OleDbType.VarChar).Value = OriginatingEvent;


    cmd.Parameters.Add("@version",OleDbType.VarChar).Value = VersionIdentifier;


    cmd.Parameters.Add("@event_type",OleDbType.VarChar).Value = EventType;


    cmd.Parameters.Add("@service_id",OleDbType.VarChar).Value = CalledService;


    cmd.Parameters.Add("@channel_name",OleDbType.VarChar).Value = AddressURI ;


    cmd.Parameters.Add("@database_id",OleDbType.VarChar).Value = OriginatingDatabase;


    cmd.Parameters.Add("@org_id",OleDbType.VarChar).Value = OrganizationID;


    cmd.Parameters.Add("@site_code",OleDbType.VarChar).Value = SiteCode;


    cmd.Parameters.Add("@user_id",OleDbType.VarChar).Value = UserID;


    cmd.Parameters.Add("@xml_data",OleDbType.VarChar).Value = XMLData;


    cmd.Parameters.Add("@event_status",OleDbType.VarChar).Value = "Error";


    cmd.Parameters.Add("@error_text",OleDbType.VarChar).Value = ErrorText;


    cmd.Parameters.Add("@msgs_code",OleDbType.VarChar).Value = MessageCode;


    cmd.Parameters.Add("@responsibility_id",OleDbType.VarChar).Value = ResponsibilityID;


    cmd.Parameters.Add("@row_added_ts",OleDbType.Char).Value = RowAddedTimeStamp;


    cmd.Parameters.Add("@csi_logicalid",OleDbType.VarChar).Value = LogicalID;


    cmd.Parameters.Add("@csi_component",OleDbType.VarChar).Value = Component;


    cmd.Parameters.Add("@csi_task",OleDbType.VarChar).Value = Task;


    cmd.Parameters.Add("@csi_referenceid",OleDbType.VarChar).Value = ReferenceID;


    cmd.Parameters.Add("@csi_confirmation",OleDbType.VarChar).Value = Confirmation;


    cmd.Parameters.Add("@csi_authorizationid",OleDbType.VarChar).Value = AuthorizationID;


    cmd.Parameters.Add("@csi_creationdatetime",OleDbType.VarChar).Value = CreationDateTime;


    cmd.Parameters.Add("@csi_bodid",OleDbType.VarChar).Value = BODID;


    cmd.Parameters.Add("@csi_responsibility_id",OleDbType.VarChar).Value = CSIResponsibilityID;


    cmd.Parameters.Add("@csi_portreference",OleDbType.VarChar).Value = PortReference;


    cmd.Parameters.Add("@atch_set_id",OleDbType.VarChar).Value = "";


    cmd.Parameters.Add("@business_entity_id",OleDbType.VarChar).Value = BusinessEntityID;


    cmd.Parameters.Add("@event_desc",OleDbType.VarChar).Value = EventDescription;


    cmd.Parameters.Add("@build_nbr",OleDbType.VarChar).Value = BuildNumber;


    cmd.Parameters.Add("@successful_cnt",OleDbType.Integer).Value = SuccessActionCount;


    cmd.Parameters.Add("@failed_cnt",OleDbType.Integer).Value = FailuresActionCount;


    cmd.Parameters.Add("@not_processed_cnt",OleDbType.Integer).Value = NotProcessedActionCount;


    cmd.Parameters.Add("@corrected_cnt",OleDbType.Integer).Value = CorrectedActionCount;


    cmd.CommandText = SqlStr;


    cmd.Connection = m_Conn;


    int IsSuccess = cmd.ExecuteNonQuery();








    why does this doesnot work to me, it gives me an error of "should declare the variable @groupname"?





    whats rong in the above stmt??

    Post Edited (venkat raj) : 11/30/2005 1:46:47 PM GMT
     
  2.  
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page