Some Problems With Garbage Collection

Jul 3, 2004

hi evryone


I have a question!


in my ASP.NET page I use a SqlDataAdapter object for working on my database


first I declare it as a global vaiable(SqlDataAdapter objDataAdapter;)


then I construct it in my Page_Load procedure like this


(objDataAdapter=new SqlDataAdapter(strSql,objConnention))


then when I want to use it in my other procedures an error tells me that your object does not exist


for solving this error I should construct my objDataAdapter in evry procedure using it.


but I think such variables should not be erased from Heap automatically(with Garbage Collection)


because it has a reference to Stack. I mean the global variable...


any opinion ?


Thanks

View 3 Replies


ADVERTISEMENT

SSIS- The Element Cannot Be Found In A Collection. This Error Happens When You Try To Retrieve An Element From A Collection On A

May 19, 2008

hi,

this is sanjeev,
i have SSIS package, using my c# program i want to add one execute package task to this package's sequence container.


it is creating the new package with out any probelm. but when i opened the package and try to move the newly created exeute package task it is giving the following error.


the element cannot be found in a collection. this error happens when you try to retrieve an element from a collection on a container during the execution of the package



this is my code



{
Package pkg = new Package();
string str = (string)entry.Key;
pkg.Name = str;
alEntity = (ArrayList)entry.Value;

ConnectionManager conMgr;
Executable chPackage;
TaskHost executePackageTask;

Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();



//string PackagePath = @"c:Genesis.dtsx";

//p = app.LoadPackage(PackagePath, null);
p = new Package();
p.LoadFromXML(parentPackageBody, null);


p.Name = str;

//Sequence seqContainer;

IDTSSequence seqContainer;
//seqContainer = (Sequence)p.Executables["Extract Genesis Data"];
seqContainer = ((Sequence)p.Executables[0]);

string packageLocation = @"Geneva Packages";
conMgr = p.Connections["SQLChildPackagesConnectionString"];






foreach (string val in alEntity)
{
if (seqContainer.Executables.Contains("Load_" + val) == false)
{
chPackage = seqContainer.Executables.Add("STOCK:ExecutePackageTask");



executePackageTask = (TaskHost)chPackage;
executePackageTask.Name = "Load_" + val;
executePackageTask.Description = "Execute Package Task";


executePackageTask.Properties["Connection"].SetValue(executePackageTask, conMgr.Name);
executePackageTask.Properties["PackageName"].SetValue(executePackageTask, packageLocation + ddlApplication.SelectedItem.Text + @"" + executePackageTask.Name);



}
}


app.SaveToXml(Server.MapPath("../SynchronizeScript/Packages/" + ddlApplication.SelectedItem.Text + @"") + str + ".dtsx", p, null);
}






please let me know what is the wrong in my code.

thanks in advance.

regards
sanjeev bolllina
sanjay.bollina@gmail.com

View 14 Replies View Related

Garbage Query Displaying

Sep 10, 1999

Hi all!
Iīm getting a very unpleasant result when I use "SELECT * FROM <many-columns-table (40+)>". Each query row appears with overwritten columns (not all but some of them)... also outside EM window !!!
There is no data corruption on EM nor Windows, all programs remains running with no other sign but garbage overwritten... garbage dissapears after window refreshing.
Just 1 month ago I made a 2-day full reinstall of my computer, so I donīt know what program could install an offending module/DLL/??? buy Iīm sure it was working before. I hate that!
Have you ever noticed something like that?
Do you think is a DLL problem?
Do you know a turn around? (I donīt want to reinstall all again!!!)
Actually Iīve tried reinstalling SP4, SP5 on WS, uninstalling/reinstalling Client with no luck...
Thanks,
Cesar.

View 1 Replies View Related

Garbage In Sql Server Log Files

Mar 4, 2004

hi,
My database server had hung up recently, and I had to restart it.
After checking the log I found some garbage entries in it.
has anyone encountered similar errors?
harshal.

View 5 Replies View Related

Flatfiles With Garbage Data

Nov 13, 2006

I was testing my packages today and my packages were running sucessfully when I didnt have any valid data in the flat file. One the reason was as not rows were returned from the flat file none of the validation script components returned any err.

How do I count the # of rows which were read from flat file from the package and continue only if there is more than one row.

I tried using conditional split but as I wont have the row count value availble till the dataflow task runs this didnt help.

Is it best for me to have two dataflow tasks one resturns the count of records from flat file and the other starts if there are any rows. Now my problem is if I have rows to process how to I transfer the flatfile data to validate from DataFlowTask1 to DataFlowTask2?

I have a script task whcih counts the rows and decides to the TaskResult but once the TaskResult is sucess how do I use the values read in DataFlowTask1?



Appreciate ur help in advance

View 9 Replies View Related

OSQL Output File Garbage

Jul 20, 2005

Everybody,I've been doing a lot of on-line research and cannot findany reference to the exact problem I'm having.Let me preface this question with the fact that I'm comingfrom an Oracle background so my approach may not be the bestway to tackle this. However, from the research I have donethis approach seems reasonable. Also, I know about theundocumented procedure sp_MSforeachtable. That can give me aresult similar to what I'm looking for but the format of theoutput is not what I need.Now the problem. I'm trying to write a reusable script to giveme a list of all the tables in a database that have 1 or more rows.My approach is to a BAT file (see script 1 below) that calls OSQLtwice, once to call a SQL script (see script 2 below) that uses theInformation_Schema views to generate the SELECT COUNT(*) statementsand fill in all the tables names in the database, write this to atemporary output file and the second OSQL command to read thetemporary output file and generate me the results formatted theway I need.The result of the first OSQL run is correct EXCEPT for 1> 2> 3> 4> 5>6> 7> 8> 9> 10> 11> 12> 13> garbage at the beginning of the file.Because of this garbage the 2nd OSQL command blows up! Anyone haveany idea what is generating this garbage?If I manually edit out the garbage and then just run the 2nd OSQLcommandI get similar garbage in the final result file (see 2nd result filebelow).In Query Analyzer, when I run the GET_TABLE_COUNT.SQL Script manuallythen take its output and copy and paste it to a new query window andrun that it works OK except for generating lots of blank lines wherethe result of the tables that have zero rows are. I am suppressingheadings but am still getting the blank lines but at least it works!Any ideas anybody? Thanks For Any HelpFYI -- SQL Server 2000 with SP3a.Bob================== Script 1 - BAT File to Call OSQL ===============@echo off@echo ************************************************** *************@echo .@echo get_table_count.bat@echo .@echo Before you run this script change to the drive and directory@echo where the input SQL script is located!@echo .@echo Input parameters:@echo 1) SQL Server userid@echo .@echo You will be prompted twice for your password!@echo .@echo The output is written to file TABLE_COUNT_RESULT.TXT@echo .@echo ************************************************** *************pauseosql -U %1 -S devkc-db -d C3T_Architecture -i get_table_count.sql -otemp_table_count_query.txt -h-1 -w500osql -U %1 -S devkc-db -d C3T_Architecture -itemp_table_count_query.txt -o table_count_result.txt -h-1 -w500del temp_table_count_result.txt@echo on================================================== ==================================== Script 2 - GET_TABLE_COUNT.SQL Script ===============set nocount onselect 'set nocount on'select 'select ''Table Name Count'''select 'select ''========== ====='''select 'select '''+ table_name+ ''', count(*) from '+ table_name+ ' having count(*) > 0 'from information_schema.tableswhere table_type = 'BASE TABLE'order by table_name================================================== ================================ Partial Result of 1st OSQL Run ==========================1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> set nocount onselect 'Table Name Count'select '========== ====='select 'ACT_ASSERTION_RULE', count(*) from ACT_ASSERTION_RULE havingcount(*) > 0select 'ACT_ASSOC', count(*) from ACT_ASSOC having count(*) > 0select 'ACT_DOC', count(*) from ACT_DOC having count(*) > 0================================================== ================================ Partial Result of @nd OSQL Run ==========================1> 2> 3> 4> ... I edited out the intervening numbers for this message.... 664> 665> 666> 667> Table Name Count========== =====.... I edited out lots of blank lines in the result for this messagebefore I get to the first table with 1 or more rows ...ARCH 6================================================== ====================

View 2 Replies View Related

Atlernative To SQL Server Management Studio (i.e. Garbage) . Any Suggestions?

Oct 26, 2007

Folks I have recently had the misfortune of moving to SQL Server Managment Studio as per our upgrade to SQL 2005. There is no doubt that SQL Server Management is a major disappoinment compared to Enterprise manager.
The UI is the biggest disaster I have ever seen. Getting rid of the SQL Query analyzer tool was a TERRIBLE idea. The UI is buggy and unfriendly. It is a major POS. I hope someone in the SQL Dev team is listening / reading this post (hellooooo anybody homeee......)
 Now that I have vented my frustration ...
 I wanted to know any atlernatives to the SQL Server Management Studio. There are plenty of 3rd Party tools out there I wanted to find out from this forum which popular 3rd Party tools are most developers using
 Thanks for bearing with me.
 

View 7 Replies View Related

Deploy To Production Server / SSIS Writes Out Garbage Data

Apr 2, 2015

I built a SSIS(writing out to a flat file ) in 32 bit machine and it woks fine . But however when I deploy to the produciton server(64 bit) the SSIS writes out garbage data . After some research I found out that the problem with the 32 bit OS and 64 bit OS problem.What is my next step. Am I out of luck that now I will have to redesing the SSIS in 64 bit?

View 5 Replies View Related

Which Collection

Jan 28, 2008

i want to use datebase wich suport all latin languages but i cant find the collection
esspeacily
eng,
german,
france and Turksh

View 4 Replies View Related

Database Collection

Feb 27, 2004

I recently migrated a database from server A to server B. The backup jobs I am trying to build on server B are failing because of the following error:
--------------
[Microsoft SQL-DMO] Error 21776: [SQL-DMO]The name 'WinDat' was not found in the Databases collection. If the name is a qualified name, use [] to separate various parts of the name, and try again.
-------------

How do I add this database to the databases collection so it will be recognized?

Thanks in advance for your time and help.

View 9 Replies View Related

ReportItems Collection

Aug 16, 2007

I can add two reportitem controls, ie reportitems!begbal.value + reportitems!deposits.value, without a problem. However, when I add the 3rd reportitem control to the expression, ie + reportitems!withdrawals.value, some really funky arithmetic occurs. All of these controls I am referring to are in the same group footer.

Any help out there would be greatly appreciated.

View 1 Replies View Related

NameValueCollection How To Add In Collection Using Loop

Feb 9, 2007

actuallu  the earlier obviously worked but now i am fetching values from 2 colums and in collection we can pass 2 strings i did that.but then how to increment the collection c.will just post the code .
query fetching 2 records
can add only 1
NameValueCollection c = new NameValueCollection();
cmd2.CommandText="select  Pname ,HoursWorked   from TimeSheet1 ts , ProjResource pr,ProjectDetails pd where ts.rid = pr.rid and ts.pcode=pr.pcode and pd.Pcode = ts.Pcode and pr.Rid = '" + Ridtxt.Text + " '";
cmd2 .Connection = con1;
con1.Open();
SqlDataReader dr = cmd2.ExecuteReader();
 
while (dr.Read())
{
c.Add(dr["pname"].ToString(), dr["hoursworked"].ToString());
}
 
as earliar 
supose c#  12
asp 11
only c# getting added
even though loop is while dr.read()
{
 }
actually how to increment key as in c  both strings are occupied

View 3 Replies View Related

Pass A Collection To A SPROC

Feb 12, 2005

I am collecting companyID's form a data grid, I want to pass the selected values to a sproc via a variable. Any idea on the syntax?

this works using a query string within my code

WHERE (dbo.Promotions.ExpirationDate > GETDATE()) AND (dbo.Promotions.CompanyID IN (" + selectedCompanies + "))

this doesn't within my sproc

WHERE (dbo.Promotions_ByLink.ExpirationDate > GETDATE()) AND (dbo.Promotions_ByLink.CompanyID IN (@SelectedCompanies))

I also tried

WHERE (dbo.Promotions_ByLink.ExpirationDate > GETDATE()) AND (dbo.Promotions_ByLink.CompanyID IN (SELECT @SelectedCompanies))

and

WHERE (dbo.Promotions_ByLink.ExpirationDate > GETDATE()) AND (dbo.Promotions_ByLink.CompanyID IN (' + @SelectedCompanies + '))

Thanks

View 4 Replies View Related

Changing The Unicode Collection

Oct 26, 2000

hi , what is the script to change the unicode collection in sql server 7.0
Ahemd

View 1 Replies View Related

ADO Does Not Add To Errors Collection After The Second FETCH NEXT In A SP

Feb 6, 2006

I'm having trouble obtaining errors raised in a stored
procedure via the ADO Errors collection after the second
FETCH NEXT statement from within that stored procedure.


Consider the following table created in a SQL Server
database:


CREATE TABLE TestTable
(
TestInt int
)
go


INSERT TestTable(TestInt) values(1)
INSERT TestTable(TestInt) values(2)
INSERT TestTable(TestInt) values(3)


This is a very simple table with one column, and three
rows containing the values 1, 2 and 3.


Consider this stored procedure:
CREATE PROCEDURE TestStoredProc
as
BEGIN
set rowcount 0
Set NoCount ON


declare @TestInt int
declare @ErrMsg char(7)
declare TestCursor cursor forward_only for
select * from TestTable


open TestCursor
Fetch next from TestCursor into @TestInt


While @@fetch_status<>-1
Begin
select @ErrMsg = 'Error ' + convert(char, @testint)
raiserror(@ErrMsg, 16, 1)
raiserror(@ErrMsg, 16, 1)
Fetch next from TestCursor into @TestInt
end


Close TestCursor
DeAllocate TestCursor
return
END


This stored procedure simply defines a cursor on all rows
in TestTable. For each row fetched from the cursor, the
error message 'Error n' is raised twice, where n is the
integer that had just been fetched from the cursor.


Finally, consider this VB code using ADO to execute the
above stored procedure. After the stored procedure is
executed, the code loops through the errors collection,
and creates a message box for each error in the collection:


Private Sub Form_Load()
Dim cn As Connection
Dim cm As Command
Dim oErr As Error


On Error Resume Next


Set cn = CreateObject("ADODB.Connection")
cn.Open "Data Source=<Some SQL Server>; Initial
Catalog=<Some Database Name>; Provider=SQLOLEDB; Persist
Security Info=False; Integrated Security=SSPI"


Set cm = CreateObject("ADODB.Command")
Set cm.ActiveConnection = cn
cm.CommandType = adCmdStoredProc
cm.CommandText = "TestStoredProc"
cm.Execute


For Each oErr In cn.Errors
MsgBox oErr.Description
Next


End
End Sub


When this code is executed, only two message boxes appear
with the message "Error 1".


Any help on this matter would be greatly appreciated :)

View 3 Replies View Related

XML Schema Collection Question

Nov 13, 2007

If I have N different xml document formats and I want to store those xml data files as typed xml in one table (one column), can I do it using xml schema collection (by adding schema file to schema collection for each document type and assigning xml schema collection to this column)?

Is this possible using xml schema collection? Or did I miss something about xml schema collection usage scenario?



Thank you!

View 4 Replies View Related

Data Collection From Many To One Servers

Mar 7, 2008

I need to feed head office sql server with the data from regional servers. Servers are spread through all continents
Data input done locally on Head office server as well and plus need to ship data from other servers.
So clarify this - Head office server is not standby one. Mirroring is out of the picture, I think..
Initially, I thought ship a log every 15 min and restore on Head office server but is this going to create an issue for the local data processing?

Any bright ideas welcome!

View 2 Replies View Related

Collection Of Stored Procedures

Apr 7, 2008



Is it possible to address the whole set of user stored procedures in one command?

For example, I want to GRANT EXEC on all sprocs in my db; can I do it in one command or do I have to do the GRANT for each sproc individually?

View 19 Replies View Related

Not Sure What Variables Collection Are And How Toset Them

Mar 27, 2008



Precedence Constraint Editor Values:
Expression Operation: Expression and Constraint
Value: Failure
Expression: @GotRecs == 1
Radio button: Logical AND. All contraints must evaluate to True

Stored Procedure has an IF (that contains a SELECT) statement that checks for records if no records are returned processing stops. I SET the parameter after the BEGIN that follows the IF statement.

The step that contains the above code is step #3. I placed the constraint between step #3 and step #4 (Data Flow task) just Exports to a Flat File.

When I clicked the TEST button in the Precedence Constraint Editor I got the following msg:
Error at Constraint 3: The variable €œGotRecs€? was not found in the variables collection. The variable might not exist in the correct scope.

View 12 Replies View Related

How Can I Return A Collection Instead Of A SqlDataReader?

Jan 12, 2008

I have to create a CLR Proc for Reporting Services report that will use SharePoint (MOSS 2007) assemblies, so my datasource won't be a database, but the SharePoint object model that returns a collection.

How can I return these data (it's not necessary to be a collection exactly) without having to create a temp table just to return the SqlDataReader?

Thanks.

And sorry for my previous message, I just forgot that I was posting a message at the Global MSDN forums.

View 1 Replies View Related

SQL 2012 :: Data Collection (MDW) - TempDB

Mar 30, 2014

It is possible that Data Collection can cause massive increasing MB/sec to tempdb ? I cannot find connection with tempdb and I set cash file, but on same disk.

Or it can be something different? Last two weeks what I checked was Read/Write MB/s to tempdb increasing progressively.

One time it was about 20MB/sec

After it was reseting and again 1MB/sec..

What I checked , External company which install SQL Server made one file for tempdb, next week or during breaktime(it will be possible), I would like make 8files next weekend work.

Now I saw that TempDB mdf was still increased, but using was just 8-10%

View 2 Replies View Related

[SQL-DMO]The Name 'tdb_grabowy1' Was Not Found In The Databases Collection.

Jul 20, 2005

We need to copy about 25 databases whenever we get a new softwaredelivery. Currently, the process is to manually use the DTS databasecopy wizard.Doing some research, I created a DTS package to copy databases. Butthis was not going to work since I have to hard code the databasenames in the package. Back to RTFMing, I discovered the DynamicProperties Task. So now I setup a .bat file that calls dtsrun and viaglobal variables passes in the source and target database names to thecopy db DS package.I did a simple test against a test database that I have and it worked.But when I tried it against some "real" databases I get the followingerrors. I have searched and googled but I have not found anything.Help???DTSRun OnError: Copy SQL Server Objects, Error = -2147199728(80045510)Error string: [SQL-DMO]The name 'tdb_grabowy1' was not found in theDatabases collection. If the name is a qualified name, use [] toseparate various parts of the name, and try again.Error source: Microsoft SQL-DMOHelp file: SQLDMO80.hlpHelp context: 1131

View 2 Replies View Related

Non-existing Field In Fields Collection

Apr 11, 2007

I'm developing a report in RS 2000 that uses two datasets. The first dataset provides data to a drill-down report on the top part of the screen and the second small dataset provides some data for additional summary information on the bottom of the screen. I'm getting a runtime error "An unexpected error occurred in Report Processing. The expression referenced a non-existing field in the fields collection." Of course, I've edited every expression I can think of: text boxes, data grid, parameters, filters, drill-down lists... I think I've gone through every object on the report but I can't isolate the bad expression. Can anyone suggest a better way to debug this type of error? It compiles fine, but fails in runtime. thanks.

View 1 Replies View Related

EXEC Permission On A SCHEMA COLLECTION???

Jan 15, 2007

I have a permissions problem with a table/procedure that I hope someone can help me with.

To set the scene .......

All my procs/tables/functions etc are owned by dbo.
I have a windows security group that is granted permissions to EXEC all procs. No one has permissions to tables.
I have a table that has an XML column and the column has a schema collection bound to it.
The table has a computed column that relies on a function to extract a datetime element from the XML in the XML column and I have an index on this computed column.
I have a proc that selects from this table and uses the computed date column for filtering. However, the select statement is build dynamically and uses sp_execute to perform the SELECT. This of course breaks the ownership chain.
To fix the above I have a user that was created from a certificate and the above proc is signed with the certificate. The user is granted select privileges on the table. This fixes the problem. (In fact, all procs/functions/triggers are signed in this way).

Now (finally) the problem ....

When I run the above proc as admin, it works fine.

When I run it as a member of the security group (mentioned earlier) I receive ...

EXECUTE permission is denied on object 'my_schema_collection', database 'mydb', schema 'dbo'

The 'my_schema_collection' mentioned above is the schema collection to which my xml column is bound.

What? How can I grant EXEC permission to a schema collection?

Anyone have any ideas?

Thanks,

~swg

View 4 Replies View Related

Dts.Variables Collection, Threading, And Contention

Apr 29, 2008

All,

We are experiencing some problems when running the same package on multiple threads of a C# application concurrently. The package instances seem to share a Dts.Variables collection.

I have created a test application and package to reproduce the issue. The package is very simple. It has two variables - Instance (Int32) and Content (string). The test application runs two concurrent threads that run through 25 iterations running the package. Each thread loads the package, sets the instance, and then runs the package. The package then takes the instance, sticks it in the Content variable and then writes it to a file called "FileX" where X is the Instance. Thread 1 sets the instance from 1 to 25, thread 2 sets it from 26 to 50. The test execution results in about 15% of the files containing the incorrect "instance content". That is, I'll see "42" in the file named "File14", or something along those lines. This tells me that the variables are being overwritten.

I ran another test where I created a copy of the package, so the code is identical, but the VersionGUID is different. Running the thread test application always succeeds. There is no file name/content mismatch. I then ran another test where I manually edit the XML of the package to change the VersionGUID before the package is loaded (by calling LoadFromXml). Again this never fails.

Changing the VersionGUID may work for us, but it is a total hack. Has anyone else experienced this or have any other solutions? Any thoughts on manually updating the VersionGUID to get around this problem? I hate doing this, but we are getting desperate.

Thanks in advance,

Rob

View 2 Replies View Related

Getting The Database Collection Doesnt Always Wrok

Sep 24, 2006

why doesn't this code always work?

<code>

Dim conn as serverconnection=New serverconnection(".SQLEXPRESS")

Dim srv as new server(conn)

Dim db as database

for each db in srv.databases

cmbDBfilenames.items.add(db.Name.tostring)

Next

</code)

If the databases are located in the applicatio path , it doesn't pick them up



View 1 Replies View Related

Index Was Out Of Range. Must Be Non-negative And Less Than The Size Of The Collection.

May 25, 2008

I'm Using a CLR for creating a trigger on database tables, 
This is my Exception :
A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightInsert': System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSEA .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightInsert': System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user defined routine or aggregate 'AvailableFlightTrgg': System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index System.ArgumentOutOfRangeException: at System.Collections.ArrayList.get_Item(Int32 index) at Triggers.AvailableFlightTrgg() . INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1'); The statement has been terminated. System.Data.SqlClient.SqlException: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages) at Microsoft.SqlServer.Server.SmiEventSink_Default.DispatchMessages(Boolean ignoreNonFatalMessages) at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteToPipe(SmiContext pipeContext) at Microsoft.SqlServer.Server.SqlPipe.ExecuteAndSend(SqlCommand command) at StoredProcedures.AvailableFlightInsert(Decimal AvailableFlightTimeTableID, Decimal Availabl... INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1');RT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1'); The statement has been terminated. System.Data.SqlClient.SqlException: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages) at Microsoft.SqlServer.Server.SmiEventSink_Default.DispatchMessages(Boolean ignoreNonFatalMessages) at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteToPipe(SmiContext pipeContext) at Microsoft.SqlServer.Server.SqlPipe.ExecuteAndSend(SqlCommand command) at StoredProcedures.AvailableFlightInsert(Decimal AvailableFlightTimeTableID, Decimal Availabl... INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('283','50','23','4','2','6','15','1','5','4','5/25/2008 8:30:00 AM','5/25/2008 7:00:00 AM','6/26/2008 12:00:00 AM','5','AR2580','125','0','False','False','1','Flight created on 5/25/2008 00:00:00','1', 'I', GETDATE()); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','7','125','125','0','0','Flight created on 5/25/2008 00:00:00','1'); INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('283','4','25','25','20','20','Flight created on 5/25/2008 00:00:00','1');
This is my Code :case TriggerAction.Insert:using (SqlConnection connection = new SqlConnection(@"context connection=true"))
{
connection.Open();command = new SqlCommand(@"SELECT * FROM INSERTED;", connection);
dr = command.ExecuteReader();
dr.Read();AvailableFlightID = (Decimal)dr[0];
AvailableFlightTimeTableID = (Decimal)dr[1];AvailableFlightAirlineID = (Decimal)dr[2];
AvailableFlightRoutingID = (Decimal)dr[3];AvailableFlightAPTerminalIDOrg = (Decimal)dr[4];
AvailableFlightAPTerminalIDDest = (Decimal)dr[5];AvailableFlightAirCraftID = (Decimal)dr[6];
AvailableFlightFlightStatusID = (Decimal)dr[7];AvailableFlightCateringID = (Decimal)dr[8];
AvailableFlightPayLoadTableID = (Decimal)dr[9];AvailableFlightArrTime = (DateTime)dr[10];
AvailableFlightDeptTime = (DateTime)dr[11];AvailableFlightDate = (DateTime)dr[12];
AvailableFlightDayName = (int)dr[13];AvailableFlightFlightNo = (String)dr[14];
AvailableFlightCapacity = (int)dr[15];AvailableFlightFreeBaggage = (int)dr[16];
AvailableFlightHaveChild = (bool)dr[17];AvailableFlightHaveParrent = (bool)dr[18];
AvailableFlightCommissionPercent = (int)dr[19];AvailableFlightRemark = (String)dr[20];AvailableFlightUserID = (Decimal)dr[21];
dr.Close();f (AvailableFlightID != 0)
{command = new SqlCommand(@"INSERT [SamaCRSHistory].[dbo].[AvailableFlight] VALUES ('" + AvailableFlightID + @"','" + AvailableFlightTimeTableID + @"','" + AvailableFlightAirlineID + @"','" + AvailableFlightRoutingID + @"','" + AvailableFlightAPTerminalIDOrg + @"','" + AvailableFlightAPTerminalIDDest + @"','" + AvailableFlightAirCraftID + @"','" + AvailableFlightFlightStatusID + @"','" + AvailableFlightCateringID + @"','" + AvailableFlightPayLoadTableID + @"','" + AvailableFlightArrTime + @"','" + AvailableFlightDeptTime + @"','" + AvailableFlightDate + @"','" + AvailableFlightDayName + @"','" + AvailableFlightFlightNo + @"','" + AvailableFlightCapacity + @"','" + AvailableFlightFreeBaggage + @"','" + AvailableFlightHaveChild + @"','" + AvailableFlightHaveParrent + @"','" + AvailableFlightCommissionPercent + @"','" + AvailableFlightRemark + @"','" + AvailableFlightUserID + @"', '" + "I" + @"', " + "GETDATE()" + @");", connection);
pipe.Send(command.CommandText);
command.ExecuteNonQuery();command = new SqlCommand(@"SELECT TimeTableSubClassSubClassID , TimeTableSubClassMaxCapacity, TimeTableSubClassWaitListCapacity FROM [SamaCRS].[dbo].[TimeTableSubClass] Where TimeTableSubClassTimeTableID = '" + AvailableFlightTimeTableID + "'", connection);
dr = command.ExecuteReader();
 System.Collections.ArrayList SubClassIDList = new System.Collections.ArrayList();
System.Collections.ArrayList SubClassCapacityList = new System.Collections.ArrayList();System.Collections.ArrayList SubClassWaitListCapacityList = new System.Collections.ArrayList();while (dr.Read())
{
SubClassIDList.Add(dr["TimeTableSubClassSubClassID"]);SubClassCapacityList.Add(dr["TimeTableSubClassMaxCapacity"]);SubClassWaitListCapacityList.Add(dr["TimeTableSubClassWaitListCapacity"]);
}
dr.Close();
SubClassIDList.TrimToSize();
SubClassCapacityList.TrimToSize();
SubClassWaitListCapacityList.TrimToSize();int CountID = SubClassIDList.Count;for (int i = 0; i <= CountID; i++)
{
command = new SqlCommand(@"INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('" + AvailableFlightID + @"','" +SubClassIDList[i] + @"','" +
SubClassCapacityList[i] + @"','" + SubClassCapacityList[i] + @"','" +
SubClassWaitListCapacityList[i] + @"','" + SubClassWaitListCapacityList[i] + @"','" +
AvailableFlightRemark + @"','" + AvailableFlightUserID + @"');", connection);
pipe.Send(command.CommandText);
command.ExecuteNonQuery();
}
 
////----------------------------------------
}
 
}
break;
 
this Code doesnt Work , but before writing this one I used the Code Below and It was working perfectly,
Previous Working Code :
//Initialize all TimeTable Classes for Created Flightcommand = new SqlCommand(@"SELECT TimeTableSubClassSubClassID FROM [SamaCRS].[dbo].[TimeTableSubClass] Where TimeTableSubClassTimeTableID = '" + AvailableFlightTimeTableID + "'", connection);
dr = command.ExecuteReader();
 System.Collections.ArrayList SubClassIDList = new System.Collections.ArrayList();while (dr.Read())
{
SubClassIDList.Add(dr.GetValue(0));
}
dr.Close();
SubClassIDList.TrimToSize();foreach (object AvailableFlightSubClassID in SubClassIDList)
{command = new SqlCommand(@"INSERT [SamaCRS].[dbo].[AvailableFlightSubClass] VALUES ('" + AvailableFlightID + @"','" + AvailableFlightSubClassID + @"','" + AvailableFlightCapacity + @"','" + AvailableFlightCapacity + @"','" + 0 + @"','" + 0 + @"','" + AvailableFlightRemark + @"','" + AvailableFlightUserID + @"');", connection);
pipe.Send(command.CommandText);
command.ExecuteNonQuery();
}
 
Can ANy one Help me with this Exception , I have Checked The Tables for Number of Columns , its not from Column numbers ,I Think iys from For() Loop????????
 
 
 

View 1 Replies View Related

Realtime Data Collection - How Do I Put SQL7 In Charge?

Feb 6, 2000

I have a product where we feed an SQL 7 DB data collected from Manufacturing. Presently, the Data transport Program is in charge of getting prepared data from machines and inserting into the DB. This design assumes SQL7 is always ready and able - which is not true due to customer queries or backups or etc. consuming resources. There is a low level buffer in system at manufacturing level if transport dies, but transport is ignorant of SQL distress, so keeps hammering DB's frontdoor. I'm looking for help in putting SQL server in charge of allowing data in - when resources are adequate. Seems I need a function that can determine server stress QUICKLY to forestall transport program and a buffer for records at the transport layer. Anyone know / done a system where SQL server CHECKS for waiting records or OK's an external program to send until told to stop? What indicates (reliably) low server resources? Anyone ever used MSMQ?


"Black Holes are proof SOMEBODY, SOMEWHERE really did have a particularly bad Y2K problem!"

View 7 Replies View Related

[howto] Write A Function That Process Row Collection

Mar 31, 2004

something like max,min?
help please!!!

View 5 Replies View Related

SQL 2012 :: Data Collection Centralized Database - MDW

Apr 17, 2014

I Enabled Data Collection on one of the server and planned to make it as Centralised Management Data Warehouse I configured data collection on it and can view reports. Next, I went to other server and configured "Set up data collection" to use my first instance as the centralised Database. But the issue is I can only see reports of first server. Am I missing something here.

I did exactly as explained in this video [URL] .....

View 9 Replies View Related

Com Exception When Removing ErrorOutPut Column From The Collection.

May 16, 2006



OutCollection[1] holds the erroroutput columncollection.

metaData.OutputCollection[1].OutputColumnCollection.RemoveObjectByID(errOutputCol.ID);

some times 1 Or 2 columns gets deleted, after that the exception is raised.

View 1 Replies View Related

Command.Parameters Collection Populated Automatically

Jan 31, 2007

Hi,

We have a lot of VB6 code that uses ADO 2.7 and stored procs wih Sql 2005. I have noticed recently that if I use the follow code:

Dim con As New ADODB.Connection
con.ConnectionString = "driver={SQL Server};server=(local);database=test;uid=sa;pwd="
con.Open

Dim com As New ADODB.Command

com.ActiveConnection = con
com.CommandText = "usp_GetSetting"
com.CommandType = adCmdStoredProc

com.Parameters.Append com.CreateParameter(...)


It will fail. the reason being the after setting the CommantText and Type ADO then seems to automatically go away and populate the Parameters collection from the databases metadata according to the SP we are calling.

I have never seen this before, I thought the Refresh method had to be called before the parameters collection get populated.

Can anyone help me please?

View 1 Replies View Related

Setting Collection Element Value Using Expression Fails

Jul 26, 2006

I'm trying to set the value of the SelectedDatabases collection property of an Update Statistics Task using an expression for the task, basing it on a user variable. Ultimately, I'll set that variable's value from a configuration file at run time and thereby specify the database whose statistics I want to update.

When I set this up in the designer, I get an error at the time I try to save the package:

TITLE: Microsoft Visual Studio
------------------------------

Nonfatal errors occurred while saving the package:
Error at Update Statistics Task: The result of the expression "@[User::SelectedDatabase]" on property "SelectedDatabases" cannot be written to the property. The expression was evaluated, but cannot be set on the property.

Error at Update Statistics Task: The result of the expression "@[User::SelectedDatabase]" on property "SelectedDatabases" cannot be written to the property. The expression was evaluated, but cannot be set on the property.




------------------------------
BUTTONS:

OK
------------------------------


I used the expression editor's expression builder to select the user variable, so I assume the syntax is correct. However, I'm suspecting that there's some additional syntax required to store that value in the collection's array. I cannot find any references to any special formats and am wondering if anyone know's how to do this correctly. On the other hand, maybe it is telling me setting this property from an expression is not even allowed. If it's not allowed, why is it in the list of properties to set? In any case, none of this is clear.

Any ideas or suggestions are appreciated. Thanks,

Joe

View 8 Replies View Related







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