473,513 Members | 3,328 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting while uploading datatable data to database using sqlbulk copy

45 New Member
Hi All,


I am getting error while trying to upload DataTable data into Database table using sqlbulk copy.

Format of the initialization string does not conform to specification starting at index 0.



Expand|Select|Wrap|Line Numbers
  1.   using (var copy = new SqlBulkCopy(conn.ToString(), SqlBulkCopyOptions.KeepIdentity & SqlBulkCopyOptions.KeepNulls))
  2.         {
  3.             copy.ColumnMappings.Add(new SqlBulkCopyColumnMapping("atnDate", "atnDate"));
  4.             copy.ColumnMappings.Add(new SqlBulkCopyColumnMapping("StartTime", "StartTime"));
  5.             copy.ColumnMappings.Add(new SqlBulkCopyColumnMapping("EndTime", "EndTime"));
  6.             copy.ColumnMappings.Add(new SqlBulkCopyColumnMapping("MatchingOff", "MatchingOff"));
  7.             copy.ColumnMappings.Add(new SqlBulkCopyColumnMapping("CampaignID", "CampaignID"));
  8.             copy.ColumnMappings.Add(new SqlBulkCopyColumnMapping("EmpName", "EmpName"));
  9.             copy.DestinationTableName = "SAR_TimeSheet1";
  10.             copy.WriteToServer(dttblSAR_TimeSheet);
  11.         }
Dec 21 '10 #1
0 1023

Sign in to post your reply or Sign up for a free account.

Similar topics

6
4121
by: Jeff Sandler | last post by:
I have a database I created in mySQL. I've been entering data every day into the database using a Java application that I wrote. The database and the Java program are on the same Win 98 SE machine. I've been working on another program (an applet) to send and receive data over the internet. I got the applet to connect with the database and...
0
2845
by: elcc1958 | last post by:
I need to support a VB6 application that will be receiving disconnected ADODB.Recordset from out DotNet solution. Our dotnet solution deals with System.Data.DataTable. I need to populate a disconnected ADODB.Recordset from System.Data.DataTable data. Below is the source code I am implementing to test the process. I do not get any error,...
3
2334
by: Carlos | last post by:
Hello Forum, I would appreciate it if you could recommend settings to use auto-vacuum in my version 7.4 database. I am uploading several thousands records in the database at a rate of ~1 second per record (the data is uploading from a different server). I have noticed that the performance of the uploading is improved if I vacuum the...
0
3640
by: ksrajalakshmi | last post by:
Hai, I've displayed all data in a datagrid. the datasource is a dataset. the user can modify the data in the datagrid. the updated data in the datagrid to be updated in datatable. i used the following snippet,but no effects. if(dsSalaryslip.HasChanges(DataRowState.Modified)) { DataTable dtChanges = dsSalaryslip.Tables; int...
10
8240
by: Janelle.Dunlap | last post by:
In the database that I am creating I need to be able to rename the file with a name that the user specifies using the Save As Dialog window (I already have the code that brings up this window). In other words, I need to write code that makes a copy of the current database and saves it with a new name. I've read that it is a bad idea to copy...
5
5599
by: hdf | last post by:
hi i have problems uploading my database using phpmyadmin n i want to load it using the ssh termal in setd of phpmyadmin. can anyone hlp
2
3445
by: DubSport | last post by:
I have created a datatable in a function, and it is populated with data. I want to call a new function from an ASP button, and write out some of the values in the datatable, using: string RowValue; RowValue = dt.Rows.ToString(); Response.Write(RowValue); Now when I run that code from within the same function that the datatable was...
3
2731
by: Indrachapa | last post by:
I want to get how to add data to table in SQL server database using a datatable using ASP.net
2
2565
kaleeswaran
by: kaleeswaran | last post by:
hi! i want to know ..how to getting multiple rows from the database using ajax.and i pass these value to the javascript.give me solution... THANK YOU,
12
77932
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please give me some idea where I am going wrong ?? I just want to retrieve data from my emp_mstr table and display it using my JSP file... The table...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.