By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

sqlexception was caught in c#and sqlserver running code

P: 2
Expand|Select|Wrap|Line Numbers
  1. private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             try
  4.             {
  5.                 SqlConnection sc = new SqlConnection(@"Data Source=KALAS-PC\SQLEXPRESS;Initial Catalog=master;Integrated Security=True");
  6.                 sc.Open();
  7.                 using (sc)
  8.                 {
  9.                     // FILEDOWNLOADED();
  10.  
  11.                     SqlCommand cmd = new SqlCommand(@" Bulk insert csvFile from 'D:\cm02SEP2014bhav.csv' with
  12.                                       (
  13.  
  14.                                       FIELDTERMINATOR =',',
  15.                                       ROWTERMINATOR ='\n'
  16.                                       )", sc);
  17.                     cmd.ExecuteNonQuery();
  18.                     sc.Close();
  19.  
  20.                 }
  21.             }
  22.             catch (Exception ex)
  23.             {
  24.                 MessageBox.Show("Error");
  25.             }
i got this error...
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 3 (OPEN).
The bulk load failed. The column is too long in the data file for row 1, column 13. Verify that the field terminator and row terminator are specified correctly.
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".pls help me
Sep 3 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

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