.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

C# .NET SqlBulkCopy inserted row count

Posted By:      Posted Date: August 30, 2010    Points: 0   Category :Sql Server
Im using a Script task to extract data from Oracle into SQL Server using SqlBulkCopy. I need to get a count of rows inserted by the SqlBulkCopy and cant figure out how to do this. I did try the SqlRowsCopied event, but it looks like I need to fill the NotifyAfter property to get the SqlRowsCopied to fire. I am confused because if I have say 11 rows in the source, and set the NotifyAfter to 100 it doesnt fire. If I set the NotifyAfter property to 10, then the event fires and I get the count of 10 and not 11 (however, 11 rows get inserted). Is there an efficient way to get the RowsCopied for the SqlBulkCopy?  ThanksYou are so wise...like a miniature budha covered in fur. -Anchorman

View Complete Post

More Related Resource Links

how to get id value from the row inserted in a table with thr trigger.


I have a reports table with column report id and and report version. I created a trigger on this table to execute an application to do some processing each time a row is inserted in reports table. I need to pass the new report id execute this application from the trigger. How do I get the report id from the row that was inserted?


Print row count on Label



I have an SP that simply performs a COUNT(*) from a table. I'm am trying to print that number in an ASP Label. It works in Query analyzer but I cant wrap my head around how to display it in a label. Any guidance much appreciated. 

Thank you. 

Count words in the ascx file



I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).

Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?

Thanks for helping, unfortunately I'm not a programmer.

How to display a count of search results with keywords in a label?


Sorry for a basic post here; I am very new to VB!

I am currently building a search page, which includes a textbox and two drop-down lists, a search button, and a datagrid. If results are found and displayed, I would like a label to display:

(e.g.) "24 results found for 'blue sky clouds' "

...where the integer represents the results count, and the keywords and/or drop-down list selections are included in the string.

If no results are found I would like the label to display:

(e.g.) "No results were found that match your selection. Please try again"

I would also like the label to be invisible until a search occurs.

Thanks in advance!

Editor's Note: Rich Clients Count Too


It's the dead of winter here at the MSDN Magazine offices, and we're having a blast. Temperatures are making their daily struggle to stay above zero. The tempting aroma of chestnuts roasting on an open subway ventilation grate fills the city with a wintry mix of excitement and anticipation.

MSDN Magazine February 2003

get the last inserted row ( autoincrement id ) in mysql database back


In my mysql I have an autoincrement id , whenever I add a new row into database I need to store this id in other table, so how to get this autoincrement Id back?

SqlBulkCopy: the locale id '0' of the source column '<column name> ' and the locale id '1



I have same issue, can anyone help?


The locale id '0' of the source column 'StandardName' and the locale id '1033' of the destination column 'StandardName' do not match.

I have check source and destination table both are same. Please help me.

Items count in scope "not available" in on WFE while it is correct in another WFE

Recently, we added a new WFE in the farm to do load balance. After installation, the search is not working occassionally(almost 50%). It apparently hits the new server. The error message:
Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.

I checked the Items count on view scopes. It is correct on old WFE, while it is "not available" on new WFE.
 In the Office Sharepoint Server Search Seveice seeting, I checked "Use this server for indexing content" and "use this server for serving search queries". I had ever tried to uncheck ""use this server for serving search queries". It is not working, either.

Any suggestion?

How to get character count in 'Multiple Text 'column using Calculated Column?


Hi All,

I have a multiple text box in a list

I want

  • A column which lists number of characters in multiple list column example 188, 199 etc
  • Multiple character column must not have more than 200 chars
Is this possible?

Appreciate all the help!


Display last inserted column value in the Form and concurrent updates


1) I have a ORDER form which is a usercontrol(webpart in sharepoint)

    the first field is a autogenerated column given as ORD01,ORD02,ORD03...

    for this i have a column in the list which stores these values into list after user submits data.

    Now i want to show last inserted ORDER + 1 in the first field .

    i.e., when user opens this ORDER page it should show the value.

2) the second case would when user submits data simultanoeusly.


Can anyone suggest a solution for this



Count Query Execution


I have a class that being used to connect with the DB. Now I want to count how many times each web request executes the queries, but I've no idea where to store the counted value. I mean, Session wont, ViewState wont work as site also have webservices. What else I can use ?

count the num of rows in dataset



Anyone can tell me which part when wrong if my code is wrong ?

I'm using VS2010 have a dataset. Here is my code.

Dim temp_sec As Data.DataSet

temp_sec = ac.getTempTime("741", "10 July 2010")

suppose to have 13 rows yet i got my msgbox is 0 rows Undecided

count by casetypes with some logic

I have this query which displays all the SpecimenTypeNames for all our cases for a ComponentID. SELECT APVX.DOS.SpecimenType.SpecimenTypeName      FROM         APVX.ORDERS.ComponentOrder INNER JOIN                       APVX.ORDERS.ApCase INNER JOIN                       APVX.ORDERS.TestOrder ON APVX.ORDERS.ApCase.CaseID = APVX.ORDERS.TestOrder.CaseID INNER JOIN                       APVX.ORDERS.TestOrderSpecimen ON APVX.ORDERS.TestOrder.TestOrderID = APVX.ORDERS.TestOrderSpecimen.TestOrderID INNER JOIN                       APVX.ORDERS.Specimen ON APVX.ORDERS.TestOrderSpecimen.SpecimenID = APVX.ORDERS.Specimen.SpecimenID ON                       APVX.ORDERS.ComponentOrder.TestOrderID = APVX.ORDERS.TestOrder.TestOrderID INNER JOIN            &

MDX to get a count on a hierarchy

Hi I want to get the number of customers that placed orders for items from more than 2 Product Category in a month in the Adventure Works 2008 DW database. Can someone help me with the MDX expression? thanks


We have the following query:   SELECT H.VEHICLE_ID,                 COUNT(ISNULL(H.HISTORY_ID, 0))            FROM VEHICLES V LEFT OUTER JOIN VEHICLE_HISTORY H              ON V.VEHICLE_ID = H.VEHICLE_ID           WHERE H.SPEED >= 65             AND CONVERT(DATE, H.GPS_TIME) = CONVERT(DATE, DATEADD(DAY, -1, GETDATE()))        GROUP BY H.VEHICLE_ID;   Unfortunately, if there inst a record for a vehicle for the current day in VEHICLE_HISTORY, or there inst a record over 65 in VEHICLE_HISTORY, the query simply does not include the result. How can we include all results (i.e. return 0)? What we want is the number of rows returned to match the number of rows in the vehicles table. I thought doing the LEFT OUTER JOIN would take care of this, and return a result for all vehicles.   Thanks.

Triggering an event to occur within a VB.NET app if something is inserted into an SQL Server table

Let's say SQL Server is inserting arow within a table. Is there a way to let VB.NET know that an event was fired (being the inserting of the row within the table), without the need to query anything. Bascially having SQL Server tell the VB.NET app that an event was fired. It seems like it might be possible using CLR and the .NET framework integration wthin SQL Server, but I haven't found a sample program showing what I'm attempting. I understand that this topic covers SQL Server and VB.NET.  This need being for both and this forum only set for SQL Server, I thought I'd take the risk and post in this forum. Thank you in advance for any assistance.Newbie


I am using this code:                             DateTime dDated = ( DateTime )Globals.dtSets.Tables[ "mm_" + symbol ].Rows[ 0 ][ "dateTimed" ];                            dated = ( DateTime )Globals.dtSets.Tables[ "mm_" + symbol ].Rows[ Globals.dtSets.Tables[                                                                 "mm_" + symbol ].Rows.Count - 1 ][ "dateTimed" ];                            bool firstRecThere = SqlSaveAndRetrieve.doesRecordExistsInAnalytical ( symbol, dDated, "mm_" );                    &n
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