.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to check if ADO recordset object populated by SQL Exec task

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Sql Server

Hey all,


Is there a function I can use in the precedence constraint editor to check if a Exec SQL task populated an ADO recordset object?


Basically I have a select a,b,c from metadata_table where key = param and enabled = 1 and the output gets saved as an recordset object

I want the constraint to check that the object was populated before continuing and error out if not (the package should never execute with 0 rows being returned)

i've tried using 

!isnull(User::ListOfFiles) and Len(User::ListOfFiles)>0 but both return true even when 0 rows are returned

I'd rather not add a @@rowcount output parameter to the Exec SQL task

Does the object have any methods I can use in the expression bit of the constraint editor that'll check if it has any rows? Or are there any Count-like functions that'll work on it? I'm not much of a .net coder so can't think of anything else


edit: nvm I just realised I need to use a script task to set the error message anyway so I can load the object there and do a Rows.Count

View Complete Post

More Related Resource Links

How to check effective permissions for a user or group for a SQL server object or whole server?

Guys, How do I see effective permissions for a user or group for a SQL server object or whole server? For example, a user is not listed in security/logins, but he is a member of few groups and some of them have assigned permissions on SQL server (again either directly or through membership in other groups) Even when I select an object (a table), check properties/permission – it doesn’t let me select any principal, except those listed on security/logins… Anyway, what is the right way to see effective permissions for a user or group? Sorry for asking such a simple question, I’ve searched but found nothing relevant.

Error: 0xC002F304 at FTP Task, FTP Task: An error occurred with the following error message: "Object

Hi All, I'm trying the FTP Task, I configure it as follow The FTP connection manager is ftp.microsoft.com The port is 21 The credentials anonymous Retries 5 and the chunk one The time out 60 I tested the connection and I does very well     In General section I set the FTPConnection to the connection manager In the File Transfer section IsLocalVariable is set to true And I defined an FTP varriable scope that holds the path to c:\temp\FTPDestination  I set the OverrideFileAtDest to true I set the Operation to recieve files  I set IsRemoteVariable to false I set Remote path to / The task seems to be well configured  but this runtime error raises once the package is fired Error: 0xC002F304 at FTP Task, FTP Task: An error occurred with the following error message: "Object reference not set to an instance of an object." So what can I do to deal with this situation? Thank you The complexity resides in the simplicity

Writing XML data from URL to Object in SSIS Script Task

I have this URL where there is XML data. I have to extract that data from URL and dump it into DW table. I am using SSIS Script Task for that.

This is how the data looks like:
<cname>United Arab Emirates Dirhams</cname>
<cname>Afghanistan Afghanis</cname>
<cname>Albania Leke</cname>

This is the code i'm using to load it into some Object type or something. But i dont know how to do that.

public void Main()
   String URLString = "http://www.xe.com/dfs/datafeed2.cgi?beeline";
   XmlDocument doc = new XmlDocument();
   XmlTextReader reader = new XmlTextReader(URLString);

   XmlNodeList currencynodes = doc.SelectNodes("currency");
   foreach(XmlNode currency in currencynodes)
    XmlNode csymbol = currency.SelectSingleNode("csymbol&quo

Is there any way to get the Transfer SQL Server Objects Task to not throw error if an object already


I've asked this before but never got an answer. Is there a way to configure the Transfer SQL Server Objects Task so that it will only transfer objects that don't already exist in the destination? Or to skip over objects that already exist?

I do not want to "roll my own". I want to use the task in order to save time.

XMLdocument check if path exists (selectnodes throws "Object reference not set to an instance of an


Normally the code below works, EXCEPT if the xpath doesnt exist, then I get the error "Object reference not set to an instance of an object." on the 2nd line

Dim sessionXML As XmlDocument = Session("XML")
If sessionXML.SelectNodes("//root/data/compare/locations/location") IsNot Nothing Then

How can I check if the xpath exists (without a try catch preferably)?

How to update workflow task and terminate workflow using silverlight client object model.



I have created a sequential workflow using visual studio. I also created a content type inherited from the workflow-task content type. Workflow creates a task-item in the task list. I want to update the workflow task using the silverlight client object model. I find on the internet and WorkflowTask.AlterTask() method to update the workflow task item. But I didn't find the equivalent of WorkflowTask.AlterTask(). Can any one help me to update the workflow task from the silverlight client object model?

I also want to terminate the workflow instance using silverlight client object model, but i didn't find any way to terminate the workflow using client object model?

Do I need to keep a reference to the Task object?


I have a fire and forget type of operation. Normally I would call


but I'm messing around with the new Task class and was wondering if I could do the same. For example


and then not save the reference to the task. Is there a risk that the task would get cleaned up, or never even execute, if I don't save the reference to it, and it doesn't have a ContinueWith appended to it?

"Object reference not set to an instance of an object" when 1 single user tries to check out a file


We are running WSS 3.0 SP2.  We have 1 single user that started having the following occur:  When he goes into a document library in which he has contribute permissions, selects a file, picks Check Out and Edit, he is getting a pop-up stating 'Object reference not set to an instance of an object".  When he clicks on the OK button he gets another message stating that it may be a permission issue or the file may be locked for editing by another user.

I have confirmed that nobody else has the file checked out for editing.  Other users (including myself) can open the exact same files, check them out and edit them, then check them back in.

I have searched the web for this error and have not found anything useful to tell me what to try on his machine.  I’m thinking it is a local PC issue since he is the only one experiencing the issue plus I have had him log into our Citrix client and he can successfully check out and edit files there.  He has done a reboot of his machine but this did not res

Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Thinking about new C# method prototypes: object as dictionary

I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

Check All with JQuery and a Asp.Net GridView

Display a Grid on the screen with a checkbox in each row. At the bottom of the page have "Check All" button.

Typically if I need to do anything interesting I use a template column. So my GridView will look like the one below (most other columns removed for readability). The only interesting point to note is the CssClass="ApprovalCheckBox" in the CheckBox ItemTemplate.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Object-Oriented Programming Concepts

This is the first in a series of articles describing the use of object-oriented programming techniques as implemented by the C# programming language. This series follows the C# Fundamentals tutorial that beginners are advised to read first.

Overview of SharePoint Object Model

SharePoint offers a set of structured server-side objects those are widely used to program SharePoint Applications. These objects are hierarchically arranged and you can drill down through the object hierarchy to obtain the object that contains the components of SharePoint Application you need to use in your code.

What is the difference between "dynamic" and "object" keywords?

Let's take a quick look at the object keyword first. I'm not going to talk a lot about it because it's been around since C# 1.0. This keyword is nothing more than a shortcut for System.Object, which is the root type in the C# class hierarchy. (However, as Eric Lippert pointed out in his blog post, not everything in C# derives from object.) This is a powerful mechanism, since you can assign almost any value to instances of this type.

How to bind GridView and DropDownList controls using DataTable object

In .net framework 2.0, you can load a DataTable in memory by consuming a data source using a DataReader. In this version you will find the flexibility in accessing the DataReader means write access code once and use again and again using DataReader. To see the functionality of DataTable consider an example that is created using VS2005.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend