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

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

Differences Between OLE DB Destination And OLE DB Command w/ parameterized input statement

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :Sql Server
Hey, I am using an OLE DB Destination to enter data into an a400 table and I was getting very slow performance (fastload in not available for this provider). It was doing about 140 rows per minute. In testing i discovered that if i used an ole db command with a parameterized input statement (insert into library.table(blah, blah blah) values(?, ?, ?)) the performance increased dramatically. To about 1400 rows per minute. My question is, does anyone know what else the ole db destination is doing that could cause this slow down? Does the destination verify that the row has been inserted afterwords and maybe that could explain why it is so much slower? If so it may be safe to use the ole db command if i simply verify table count after completing the insert to make sure that all of the rows were entered. Or is there something else that the ole db destination is doing to where it may not be safe to do an ole db command in this way?

View Complete Post

More Related Resource Links

OLEDB/ADO Destionation - Add input column twice to destination columns or static data


(Using BIDS 2008 R2)

OLEDB/ADO Destionation

Reuse input column
Is there any way to map a input column to two destination columns?

State static value instead of mapping column
I have a package for each version of the production system - they insert in the same destination tables - I just need to add a version number to the version column - like '2.1' and '3.0'. The only way I have found so far is to select a fake column in the source like select '2.2' as Version, ..- This is however not very smart when I'm selecting millions of rows.

I would just like to be able to type in a static value instead of mapping a column - any way to do this?

How to pass SQL server 2005 instance name as a input parameter to restoressp STSADM command


I am facing a problem with restoressp STSADM command. We are using a separate SQL server 2005 instance for our SharePoint PORTAL. For e.g. the instance name is MOSSSQL. I have restored the SSP database from production environment to development environment. But facing the problem when I associate the restored SSP database with new SSP using restoressp STSADM command.

As per Microsoft guideline I have used the restorespp command to attach the database with my new SSP. If I pass the sspdatabaseserver input parameter as “servername\SQL instance name” then its giving me the error message that “required argument are mission – sspdatabase”.

Below is the command

stsadm -o restoressp   
-title “My-SSP"
-url "http://mymoss:11111/"
-ssplogin "username"
-mysiteurl "http://mymoss/mysites/"
-indexserver "MYMOSS"
-indexlocation "e:\logs\"
-sspdatabaseserver "MYMOSS\MOSSSQL "
-sspdatabasename "MySSP1_SSP"
-ssppassword "password"
-searchdatabaseserver "MYMOSS\MOSSSQL"
-searchdatabasename "MySSP1_Search"
-ssl no

Note: I have system admin rights and I am the DB owner



Senthilrajan K

OLE DB Destination SQL command - how can I select from recordset variable?


How do I insert records from connection1 into a a table with the same name on connection2 where the records in connection2 do not already exist?

The approach I'm trying is this: I have an OLE DB Source that selects records from connection1 (successfully). The flow into a recordset destination in the Data Flow. But I can't figure out how to select from this recordset using the FROM CLAUSE of a SQL Command in the OLE DB Destination component. Can someone point me to an example of this?

It seems like this would be a common task but I can't find any examples.

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).

Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


Row command working on all rows not selected one?



I have this code that hides a column in a gridview.  (The column houses another nested gridview).

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub

The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


Print command



Is there a way of setting up a print area for a part of my webpage, I only want to print a certain part of the page, when I select print at the moment it will print the whole page and the layout is rubbish!!

command object error


Could someone please tell me what is wrong with my syntax here?  I'd be much appreciative.


objCmd = New SQLCommand("SELECT CASE WHEN objDR('Item') = 'Enter Bill of Lading' then enterbol " _  

& "WHEN objDR('Item') = 'Bill of Lading History' THEN bolhistory " _  

& "WHEN objDR('Item') = 'Request Transfer' or objDR('Item') = 'View Transfer in Progress' THEN transfers " _  

& "END  from plantGroups where plantgroupid=@plantgroupid", objConn)

Validate form input - Japanese


 I've searched for several hours and haven't come up with a reference - or even many discussions - of how to go about validating Japanese names, addresses, etc. When I lived in Japan websites, atm's etc. required such info to be entered with the roman alphabet but I've seen some websites that are allowing Kanji/Hiragana/Katakana. I haven't tested many of them for validation but one that I did test (after looking at the page source and discovering no client-side validation) allowed me to put this in the name field: J*=123*go^ Neat!

Any pointers/references? Thanks

ReportViewer :: Failed to enable constraints. But my statement is valid!!

  • A
  • n error has occurred during report processing.
      • Exception has been thrown by the target of an invocation.
        • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    Why do I keep getting this error, even when not using any data on the report. When I run the query in SQL server I get a resultset. However when I try to render the report I get this error.


    Whats wrong with this statement


    Im trying to updated some old ASP pages with some new .net pages and cant seem to get this update statement to work. I need to update the current ASP code below and then once thats working im going to use that same statement in a procedure for all our new .Net pages..

    So can anyone see what im doing wrong by inserting the 2nd column to the update statement?

    strSqual = "update tas set date_completed='" & TransDate & ", trans_id=" & InsertedTransID & "' where date_completed is null and sercontract_id="& strContractID & " and DATEDIFF(dd,task_due_date,'" & strProcDate & "')<=14"


    I am trying to add an extra column to the update, but not sure if the syntax is correct.

    If Statement Issue



    This is very strange to me. I have spent 2hrs looking into this inside out , but dont seem to get it

    I have an if statement that inserts data into the database. But i check to make sure the name is not entered twice. Now when the name is already in the db, then it should insert else put out a message saying its already in the db

    My code works fine except that  when its not in the db, its inserts but still puts out the message that says "Name is already in use" Not sure if am not seeing something. But thought i did bring it to the forum. Here is my code...Pretty simple

    Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click

            Dim objConnection As SqlConnection
            Dim objCommand As SqlCommand
            Dim strSQLQuery1 As String


            ' If there's nothing to Add for then don't search
            ' o/w build our SQL Query and execute it.
            If String.IsNullOrEmpty(txtAdd.Text) Or Leadbank.SelectedValue = "000" Then


    statement cannot appear outside of a method body


    hi all,

      i am posting my vb.net problem .plz tell me how to resolve this :-

    Dim conn As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString
        'Dim mysqlconnection As New SqlConnection(conn)
        'If mysqlconnection.State=ConnectionState.closed Then mysqlconnection.Open();
        'Dim mySqlcommand As New SqlCommand("select CategoryId,CategoryName from Categories", mysqlconnection)
        'Dim mySqlDataAdapter As New SqlDataAdapter(mySqlcommand)
        'Dim mydataSet As New DataSet()

        'if mysqlconnection.State=ConnectionState.closed Then mysqlconnection.Open();

    i m getting 5 errors in this code

    declaration expected in mySqlDataAdapter.Fill method; Gridview1.DataSource=ds; Gridview1.DataBind();

    how to multiple condition in if statement in asp.net C#



    i am using if condition to find out a time

    if(time=="08 AM)


    response.write"shift A";


    but problem is how can i put multiple condition in if like

    if(time=="06 AM" and "08 AM" and "07 AM")



    Hello, i need help changing the following code into a switch...case statementUndecided

    <script runat="server">
    void Page_Load()
        if (Page.IsPostBack)
        public String toSring()
        int intcomputerChoice=1;
           if (Page.IsPostBack)

    Input Validation: Enforcing Complex Business Data Rules with WPF


    Windows Presentation Foundation has a rich data binding system that includes flexible support for business data validation. We take a look at implementing some complex data input validation scenarios that include customized data errors for users.

    Brian Noyes

    MSDN Magazine June 2010

    .NET Matters: Parameterized ThreadStart, EventWaitHandle, and More


    This month Stephen Toub answers readers questions that include: How do I pass data to a new thread? Why can't I convert from "ref string" to "ref object"? And what's the difference between EventWaitHandle, AutoResetEvent and ManualResetEvent?

    Stephen Toub

    MSDN Magazine June 2006

    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