Child Package Fails When Called From Parent

Oct 26, 2006

So I have a parent package that calls another package using the Execute Package Task. When I run the child it runs fine but when I run it from the parent i get this msg...Any ideas?

Error: 0xC00220E4 at Execute VR Account Load: Error 0xC0012050 while preparing to load the package. Package failed validation from the ExecutePackage task. The package cannot run.

View 4 Replies


ADVERTISEMENT

Execution Of Child Package From Parent Package In Sql Server 2005 Integration Services

May 21, 2007

Hi,

I created a package which passes some infornmations( through parameters) to its child package.

I need to do some processing in parent package based on execution status of child package.i.e.

if child fails then some operation and if child succeeds then other operation.

To determine the status of execution of child package I am using two differnt constraint ..one constraint is having value "Success" and other having value "Failure".

My problem is that when child packge is executed successfully the constraint with value = "Success" works properly but when child fails the constraint with value "Failure" does not work.

-Prashant

View 4 Replies View Related

Parent Package Variable Assignment Issue In Child Package.

Dec 26, 2006


We
have one main package from which 7 other child packages are called. We are using
ParentPackage variables to assign values for variables and database connections.



While the values from ParentPackage variable get assigned to some of the
packages properly, to others it doesn€™t assign the value.

For example:
Except for one of the packages the database connection string gets assigned
properly to all other packages.

Similarly, in another package one of the
variables doesn€™t get assigned. In other packages it is assigned properly.

We
have checked all the other property values and they are exactly the same.


We cannot make any head or tail of this erratic behavior.

Please Help.

View 3 Replies View Related

Passing Value From A Child Package To The Parent Package That Calls It In Ssis

May 21, 2007

hi,



I am interested in Passing value from a child Package variable to the Parent package that calls it in ssis.



I am able to call the Child package using the execute package task and use Configurations to pass values from the parent variable to the child, but I am not able to pass the value from the child to the parent.



I have a variable called datasetId in both the parent and child. it gets computed in the child and needs to be passed to the parent...





Any suggestions?



Thanks for any help in advance..



smathew

View 8 Replies View Related

Configure A Child Package To Use The Configuration File Of A Parent Package?

Sep 14, 2006

Hi guys,

Here's the deal. I have a child package, (say, pack01.dtsx), which uses a dtsconfig file for its connection string, which can be called from other packages, but which also can be called by itself.

However I also have another package (say, pack02.dtsx) which uses the same dtsconfig file for its connection string. It calls on pack01.dtsx.

When I use DTEXECUI and run pack01.dtsx, specifying the proper .dtsconfig file, it goes well. But when I try and run pack02.dtsx, an error occurs saying pack01.dtsx connection cannot be established.

How do I pass the connectionstring being used by pack02 to pack01, without having to remove the configuration file setting of pack01? Can a Parent Package configuration and a configuration file try and map to the same property?

Hope someone could help. Thanks.

View 7 Replies View Related

Transact SQL :: Parent / Child Tables - Pivot Child Data To Parent Row

May 19, 2015

Given the sample data and query below, I would like to know if it is possible to have the outcome be a single row, with the ChildTypeId, c.StartDate, c.EndDate being contained in the parent row.  So, the outcome I'm hoping for based on the data below for ParentId = 1 would be:

1 2015-01-01 2015-12-31 AA 2015-01-01 2015-03-31 BB 2016-01-01 2016-03-31 CC 2017-01-01 2017-03-31 DD 2017-01-01 2017-03-31

declare @parent table (Id int not null primary key, StartDate date, EndDate date)
declare @child table (Id int not null primary key, ParentId int not null, ChildTypeId char(2) not null, StartDate date, EndDate date)
insert @parent select 1, '1/1/2015', '12/31/2015'
insert @child select 1, 1, 'AA', '1/1/2015', '3/31/2015'

[Code] .....

View 6 Replies View Related

Resume Parent Package After Child Package Failure...

Apr 23, 2007

Hello All,



I have a SSIS Package with a "Execute Package Task" to call a child package. I am trying to have the master/parent package complete its execution regardless the outcome (failure or success) of the child package. The overall structure of the master package is:



1. Perform Pre-load tasks (stored procedure).

2. Execute Package Task (call child package)

3. Perform Post-load Tasks (stored procedure)



I have try everything and cannot get the results that I want... I have tried the combination of "failparentonfailure", "forceexecutionvalue", etc. The master package stops at childs failure. I would like to resume to completion



Any ideas out there?



Rohan

View 10 Replies View Related

SSIS Parent Package Can Not Find The Child Package

Oct 13, 2007

I have two SSIS packages in a project, one calling the other. The parent package works fine in my local mechine. After they are deployed to the production, I schedeul jobs to run the packages in the SqlServer. The child package works fine if I run it alone, but the parent package could not find its child package if I run the parent package . As I checked, all xml config files and the connection string pointing to the child package were set correctly. It seems the parent package did not use the xml config file. Can someone help me? Thanks in advance.

View 9 Replies View Related

Parent Child Package With Expressions

Mar 6, 2007

Hi there,

sorry if the message seems a bit garbled i cannot see the textbox properly with ie7/ff


anyways. the situation.


childpackage contains a loop-container. in there i use an ole-db-source with a variable
based on an expression. ie. "select * from foo where bar=" + len(@[bar]) == 0 ? "initial" : @[bar] + " and etc=1"
where bar is the variable that is set by the loop.


this works great.


however i need to call this package several times, only the expression is a tad different.


so i need a scripttask that sets the expression correctly, then i call the childpackage
and map the current-expression to the expression in childpackage.


how do i do that? or am i doing it wrong?


my script-task looks something like:


dts.Variable("theVar").Expression = " ""select * from foo where bar="" + len(@[bar]) == 0 ? ""initial"" : @[bar] + "" and etc=1"" "


in the childpackage i have a package-conf that maps thevar to thequery with target-object expression.

View 1 Replies View Related

Parent-Child Package Configurations

Sep 15, 2006

Hi All,

May be I am doing something wrong over here, but I have been trying in vain to test out a simple scenario where I can use my Parent Package configurations in my Child package. I have two packages ready and can someone please walk me through this process. Appreciate all help

Thanks

View 5 Replies View Related

Problem Of Parent-Child Package With ASP.Net

Jul 12, 2007

I have an ASP.NET application that calls a SSIS package. The SSIS package internally calls some other child packages. I observed that sometimes some child pacakges are not even called by the parent. and the behaviour is very indeterminate. sometimes they work fine. sometimes they don't. There is no clue available for this behaviour when the pacakges are not executed. (One general observation is that the memory consumption is very high. but that is the case always.)

I have enabled logging on all child packages. The log is not updated at all when the child packages failed to execute. i.e. the package execution does not start.

Could somebody explain why this is happening? any suggestions/ similar experiences?



Regards

Saurabh

View 1 Replies View Related

How To Run Encrypted Child Package From Parent Package

Aug 7, 2007


I am trying to figure out how to run an SSIS package that is encrypted but also has a child package which is encrypted. I am trying to run from the cmd line using dtexec and specifying DECRYPT <pwd> for the parent package but how do you specify for the child package.

Please help if you have seen such an issue before or you have a work around.

Thanks
Newbie

View 1 Replies View Related

Parent Package Is Losing A Child Package

Dec 4, 2006

I have a parent package which calls a number of child packages. Occasionally, I have one child package which starts up and appears to finish but the parent package never gets notification that the child has finished. If I view this in Management Studio's in Integration Services, I can view the packages that are running and only the parent package is running. Because it never gets control back, the next child package will never get started and the parent package will continue to run and never finish.

Any idea what could be happening??

View 1 Replies View Related

Parent Package Call To Child Package

Apr 30, 2007

I run into some issues and really need some expert help here.



Here is the problem. I have two packages (parent.dtsx and child.dtsx). Both package have its own configuration file (parent.dtsConfig and child.dtsConfig). The file Child.dtsConfig contains a variable (i.e. "X") that is to be used by Child.dtsx.

Inside parent.dtsx. there is a package-task that calls into Child.dtsx. It worked perfectly well if I run parent.dtsx using Dtexec or from inside SSIS's IDE.



Now I want to programmably call "parent.dtsx" from my C# code. I loaded package using "app.LoadPackage"... Inside C# code, I want to reconfigure Child-package's variable ("X"). I then loaded in "Child.dtsx". However when I run "parent.dtsx" and child.dtsx still loads the original value for "X". The reconfigured value for "X" is not updated.



Please help on how to get around this issue.



Thanks.



View 10 Replies View Related

Parent / Child Package - Connections, Variables Etc.,

Aug 13, 2007

In respect to Parent / Child packages, can some one correct me if I'm wrong.

Even if connection managers are created in Parent package, the same needs to be created in child packages if they need to connect to database. On the other hand I can just create connection strings in variable in parent package(instead of connection managers itself) and use parent package variable configuration to configure the connection string of child package with the variable value.

Sorry If I'm confusing


The same with variables, the parent variable needs to be mapped to a child variable(using parent package variable config) to be used in child package, it cannot be used as it is.

Thanks

View 3 Replies View Related

Parent - Multiple Child Package Execution

Aug 24, 2007

I have a parent package "A", I also have 4 child packages "B","B1","B2",B3"
In BIDS, I created a file connection in the package "A" to connect to the child packages. So whenever I want to run B1 or B2, I change the path in the file connection to point to B1 or B2 and so on. Since the developement environment is File system this works perfectly fine.

But in the Test / Production environment all packages are stored in the Sql server. How can I paramaterize the child package connection so that I can use configuration / variables to select which child package to execute.

Thanks

View 3 Replies View Related

Passing Multiple Values From Parent To Child Package

Dec 20, 2006

Starting with "How to: Use Values of Parent Variables in Child Packages" in the SQL Server 2005 Books Online (http://msdn2.microsoft.com/en-us/library/ms345179.aspx), it seems I need to create a separate package configuration in the child package (of type parent package variable) for each variable I want to pass from the parent to the child. Is that really so? The XML configuration file type allows me to specify any number of variables; how do I do that with the parent package variable?

For that matther, why doesn't the Execute Package Task simply allow me to specify the values of child variables (or other properties) directly? It seems SSIS has made something as trivial as a series of function calls completely opaque:

MyChildPackage(var1=1, var2="foo");

MyChildPackage(var1=2, var2="bar");

MyChildPackage(var1=3, var2="baz");

View 2 Replies View Related

Checking For Existence Of Parent Variable In Child Package

Oct 16, 2007

I have a parent package that calls a child package, when I run the parent package the child package picks up a variable value from the parent in a script task and runs fine, the problem I'm facing is when I run just the child package, the script task fails because it doesn't know about the parent variable. The dilemma I'm facing is in my child script task, if I add the parent variable to the ReadOnlyVariables list then the task fails because the parent variable doesn't exist when I just run the child. If I don't add the parent variable to the ReadOnlyVariabls list then if I try to use it then the task fails saying that the variable doesn't exist in the variables collection.

Is there a way to check for the existence of the parent variable, so when I just run the child package I don't get an error and I don't have to change my task every time I choose to run the child package only vs running the parent/child?

Thanks.

View 6 Replies View Related

SSIS Parent/Child Package Variable Passing

Feb 7, 2006

Hi

I have having trouble getting my hands around how to retrieve variables from a parent package. I read about the Environment variables and Configuration File at the parent package level and the Parent Package variable at the child level.

Here are my questions:

1. Can you only store/retrieve 1 variable in a config file at a time?

2. Does the child package have to define the variables and if so, do they have to be the same names as the parent package?

This seems so more more complex then the DTS2000 way of passing variables to and from packages.

Any help would be appreciated.

Thanks in advance,

Gordon Radley



View 7 Replies View Related

Parent Package Doesn't Recognize Child Settings

Oct 27, 2006

I have two issues:

I have a simple parent that uses an Execute Package Task to call a simple child package. The child package has a Data Flow that I disabled. When running the child package by itself, the data flow task is bypassed. When running the package via the parent the data flow task executes.

Second issue is when you disable the package configurations in the child, the parent doesn't recognize that it's diables and tries to load the configurations.

It's almost like there are some settings in a child that get ignored by the parent??

Anyone else experience this?

thx

View 1 Replies View Related

Package Configuration, Parent-child Packages And Job Scheduling

May 3, 2007

Hi,

I've found this problem that when I change settings in my configuration file it does not automatically apply to all child packages which uses the same configuration file if run from a job in SQL Server Agent. I need to open the package and save it again from BIDS. I use one "load group" package to execute all other packages.

Is there a way from the job configuration to set a setting so the package allways will have the newest configuration?

Regards
Simon

View 7 Replies View Related

Passing A Variable Between A Parent And Child Package Doesn't Work

Apr 7, 2006

Has someone managed to pass successfully a variable from a parent package to a child package? I€™ve tried a zillion permutations and I can€™t get it to work. The strange thing was that I was able to successfully do this with pre-RTM builds. Basically, what I am trying to do is:


The parent package has a variable, e.g. ExecutionID which I set using a script to System::ExecutionInstanceGUID. I verified that the variable is set correctly by dumping it to a SQL Server table.
I created a child package variable with the same name.
In the child package, I€™ve created a parent package configuration that points to the ExecutionID variable.
I am trying to read the variable in a Derived Column Task in which I have a column linked to @ExecutionID.
This doesn€™t work. Step-by-step instructions from someone who managed to concur this will be greatly appreciated.

Oh, I didn€™t have any luck hitting a breakpoint in a script task inside a child package with both in and out of process execution also.

View 1 Replies View Related

SSIS Parent/Child Package Variable Handshake Issue

Jun 23, 2006

Hi,

I having a problem getting the child package variable values into a parent package. Here is the scenario;

I have parent package(Master) calling two child packages using execute package task. I have no problem to pass variable values from the parent to child using the parent configuration but not able to get the variable values from the child to parent. I am setting the package status in each child package based on certain conditions and determine the final status in a parent based on child package variable statuses. Does any body have any idea? I will appreciate your thoughts.Thanks..Mako

View 3 Replies View Related

Excel Connection Manager Fails When Package Called Programatically

Jan 25, 2008

I've put together a SSIS package that, once a user uploads an Excel spreadsheet from a webpage, grabs it, does a mess of calculations and spits it out into a datareader (this last part is tricky, but I haven't even gotten to this point yet). In BIDS, the package works fine. Run using the 32-bit version of dtexec, it runs fine. But when I try to call it from the page, I keep getting an error. The errors look familiar enough that I'm thinking it's due to the package trying to run 64-bit, and that not playing nicely with Excel. If that's true, is there an easy way to force the 32-but version to be used? I've already set the project properties to Run64BitRuntime = false, which I'd hoped would help. but no luck.

Here's the code I'm using:




Code Snippet
string pkg = @"pathpackage.dtsx";
Application app = new Application();
Package p = app.LoadPackage(p, null);
Variable varFileName = p.Variables["strExcelFileName"];
varFileName.Vaue = strFileName;
Variable varFilePath = p.Variables["strExcelFilePath"];
varFilePath.Value = strFilePath;

DTSExecResult dte = p.Execute();

Error handling

p.Dispose();




And it kicks out the following:

-1071636471
TestReports_UploadTestReport
Connection manager "Excel Connection Manager"
Microsoft.SqlServer.Dts.Runtime.DtsError0{8BDFE898-E9D8-4D23-9739-DA807BCDC2AC}
SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040154. An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".
-1071611876
DFT - Upload spreadsheet to dataset
Excel Source [1]
Microsoft.SqlServer.Dts.Runtime.DtsError0dtsmsg.rll{8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
-1073450985
DFT - Upload spreadsheet to dataset
DTS.Pipeline
Microsoft.SqlServer.Dts.Runtime.DtsError0dtsmsg.rll{8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}
component "Excel Source" (1) failed validation and returned error code 0xC020801C.
-1073450996
DFT - Upload spreadsheet to dataset
DTS.Pipeline
Microsoft.SqlServer.Dts.Runtime.DtsError0dtsmsg.rll{8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}
One or more component failed validation.
-1073594105
DFT - Upload spreadsheet to dataset

View 3 Replies View Related

SSIS Called From Agent Job Not Calling New Child SSIS Package Addition

Oct 29, 2007

I have an SSIS package (TransAgentMaster) that I recently modified to include a call to a child package via the file system. The child package creates a text file. When I run the package in dev studio then the child package/text file is produced.

I then imported the TransAgentMaster as a stored packagesfilesystem package into SQL SSIS and executed the package. The child package produced the text file.

I then ran the SQL Server Agent to see if the child package would work and it did not generate the text file. Thus after updating a SSIS package importing the package into SSIS the job that calls the package will not call the child package. Please not that the TransAgentMaster package calls 7 children packages €¦ just not my new one.


Any thoughts why the agent will not run the child newly crated childe package?

View 3 Replies View Related

Calling Child Package Out Of Process Fails With Access Denied.

Mar 3, 2006

Has anyone ever used an Execute Package Task to call a child package, and the Execute Package Task's ExecuteOutOfProcess = True? Unless the account it runs under is an Administrator on the box, it fails for me with "Error 0x80070005 while loading package file "C:program filesmicrosoft sql server90dtsPackagesETLFact_SalesTransaction_Tracking.dtsx". Access is denied."

This is eating up hours and hours of my time, time we can't afford. Is anyone able to successfully call a child package out of process?

View 3 Replies View Related

SQL 2012 :: Group By Parent With One Child And Multiple Child Information?

Jul 25, 2014

Basically i have three Tables

Request ID Parent ID Account Name Addresss
1452 1254789 Wendy's Atlanta Georgia
1453 1254789 Wendy's Norcross Georgia
1456 1254789 Waffle House Atlanta Georgia

Bid_ID Bid_Type Bid_Volume Bid_V Bid_D Bid_E Request_ID Parent ID
45897 Incentive 10 N/A N/A N/A 1452 1254789
45898 Incentive 10 N/A N/A N/A 1453 1254789
45899 Incentive 10 N/A N/A N/A 1456 1254789

Bid_Number Bid_Name Request_ID Parent ID
Q789456 Wendy'Off 1452 1254789
Q789457 Wendy'Reba 1452 1254789
Q789456 Wendy'Off 1453 1254789
Q789457 Wendy'Reba 1453 1254789
Q789456 Wendy'Off 1456 1254789

I want the Result

Parent ID Bid_Type Bid_Volume Bid_V Bid_D Bid_E AutoGeneratedCol
1254789 Incentive 10 N/A N/A N/A 1
1254789 Incentive 10 N/A N/A N/A 2
Bid Number AutoGeneratedCol_Link
Q789456 1
Q789457 1
Q789456 2
Request ID AutoGeneratedCol_Link
1452 1
1453 1
1456 2

View 1 Replies View Related

Transact SQL :: To Get Parent / Child / Grand Child Row On Various Order?

Jun 26, 2015

I have a table with below kind of data,

DECLARE @TBL TABLE (ItemId INT IDENTITY(1,1), ItemName NVARCHAR(20), ItemDate DATE, ParentItemName NVARCHAR(20), ItemOrder INT, ReportId INT)
INSERT INTO @TBL (ItemName, ItemDate, ParentItemName, ItemOrder, ReportId)
VALUES ('Plan', '2015-06-01', NULL, 1, 20),('Design', '2015-06-01', NULL, 2, 20),('Test', '2015-06-20', NULL, 3, 20),('Complete', '2015-06-30', NULL, 4, 20),
('Design child A', '2015-06-02', 'Design', 1, 20), ('Design child B', '2015-06-01', 'Design', 2, 20),
('Test child A', '2015-06-10', 'Test', 1, 20), ('Test child B', '2015-06-09', 'Test', 2, 20), ('Test child C', '2015-06-08', 'Test', 3, 20),
('Test grand child A', '2015-06-08', 'Test child B', 1, 20), ('Test grand child B', '2015-06-08', 'Test child B', 2, 20)
select * from @TBL

Here I want,

1. to display all parent with ORDER BY ItemOrder (no need to sort by ItemDate)
2. display all child row right after their parent (ORDER BY ItemOrder if ItemDate are same, else ORDER BY ItemDate)
3. display all grand child row right after their parent (ORDER BY ItemOrder if ItemDate are same, else ORDER BY ItemDate)

Looking for below output ...

View 3 Replies View Related

Integration Services :: Executing Child SSIS Package In Parent SSIS

Oct 9, 2015

I want to achieve the following in (SSIS/SSDT for SQL 2012) - 

I have a generic SSIS package which simply sends out email notifications using SMTP email task (this package is within its own project, and has project level input parameters).

I need to be able to call this package in the Event handler section of every package (numbering in about less than 60) that we have. These packages are within their own respective projects.

I thought I could use the "execute package task", but it turns out , using this, I cannot call a package that is part of some other project. I also cannot call a package that is stored in the CATALOG. Is there any way I can do this ?

When I call the child package , I should be able to send in parameters like - error information and package name of the Parent package.

View 8 Replies View Related

Error Running Child Packages From Parent Package - Error 0xC0011008

Mar 31, 2008



Hey...

I am running a parent SSIS package (running sp2, 9.0.3042) that calls several child packages.

On our development server, we now cannot run this because we get 1 or more of these errors:

"Error 0x80004003 while preparing to load the package. Invalid pointer . "
"Error 0xC0011008 while preparing to load the package. Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored. . "

It is not occuring on the same packages. It varies every time it is run.

I can run every one of the child packages individually, using the same login ID that the parent is executed under.

The parent package works fine on my local machine and other servers running the same version of SSIS. Just not on this server.

Does anyone have any ideas???

Thanks

BobP

View 17 Replies View Related

SP Skips Execution Of Child SP When Called From C#

Sep 14, 2005

Hello all. I have a stored procedure that seems to skip the execution of an entire line of code (which happens to be a call to execute another stored procedure), but ONLY if it is being used from C# (using the System.Data.SqlClient namespace... object: SqlCommand, etc).

Basic structure:

Event SP: top-most parent
-->Calls UpdateXs SP: This is the SP that will not call his child SP
----->Calls UpdateX: This is the SP that is being ignored when called from .NET (In a loop, each iteration, max iterations 10).

(1) I can call the top-most stored procedure (Event SP) with the same arguments in Query Analyzer and all SP's will execute.
(2) I can call UpdateXs SP with the same arguments that are being passed to it from Event SP in the Query Analyzer, and again, it's child sp executes (UpdateX).
(3) I can also call the last child (UpdateX) directly in Query Analyzer with the same arguments that are passed in production (from executing the top-most parent in C#), and it executes correctly.

I'm positive that at no point the last child (UpdateX) is being passed NULL values. I made debug tables and before execution of an SP from within another SP, I store all the arguments in a debug table--none are null. Also, to figure out what was wrong with the last child (UpdateX) , the first statement in inserts into another debug table, just to show that that execution has made it into the sp--when the top parent is called from C#, it doesn't insert into my table (doesn't execute).

There are statements inside Event SP that execute after the sp call to UpdateXs SP. These statement always execute. Also, there are statements inside UpdateXs SP that execute after the sp call to the last child. These statement always execute too.

I am now clueless. I had developed & debugged all sp's in Query Analyzer before trying to use it live (with the C#). It's always fine in Query Analyzer, but ALWAYS skips the last sp in production.

Is there some fundamental principle I am missing here in MS SQL stored procedures? I am only 3 levels deep in SP calls, so I didn't think that would be an issue (I have made SP's that went a LOT deeper in calls than that in the past with no issues).

Any insight much appreciated. Thanks in advance.

View 2 Replies View Related

Bcp In Child Before Parent

May 19, 2004

Huh?

I've got good RI data...BUT..a developer loaded the tables in alpha table order....

Such that the child loaded BEFORE the parent....

Huh?

Got a test being set up now to mess with the child file to add a key that doesn't exist in the parent...

But Why is this allowed?

In DB2 you can specify

LOAD DATA REPLACE NO CHECK....

On the load card...you then need to run a check after to verify the data...

Is that what's going on? Is there such a utility in SQL Server to run a check post load?

I'm confused....

Any comments appreciated.

Thanks



Brett

8-)

View 2 Replies View Related

Insert Into Parent/child

Feb 25, 2008

hi,
i have two tables i want the identity value of the parent table to be inserted into the chile table
here is my code,but i don't know why it isn't working !
protected void Button1_Click(object sender, EventArgs e)    {        string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;        string pcontent = TextBox1.Text;        string data = TextBox2.Text;        addtopic(pcontent,connectionString);        addfile(data, connectionString);                    }    public void addtopic(string subject,string connstring)    {         using (SqlConnection connection = new SqlConnection(connstring))        {                        SqlCommand command = new SqlCommand("INSERT INTO parent" + "(content)" +              "Values(@content)", connection);            command.Parameters.Add("@content", SqlDbType.Text).Value = subject;            connection.Open();            command.ExecuteNonQuery();                    }    }    public void addchild(string name, string connstring)    {                using (SqlConnection connection = new SqlConnection(connstring))        {Guid id = Guid.NewGuid();           SqlCommand commandd = new SqlCommand("INSERT INTO child" + "(parentid,data,uniqueid)" +              "Values(@@IDENTITY,@data,@uid)", connection);            commandd.Parameters.Add("@data", SqlDbType.NVarChar, 50).Value = name;            commandd.Parameters.Add("@uid", SqlDbType.UniqueIdentifier).Value = id;           
 
thanks in advance :)
           
            connection.Open();            commandd.ExecuteNonQuery();        }
    }

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved