Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
GeneralRe: Read & Display a huge text file in textbox Pin
AspDotNetDev24-Feb-10 22:34
protectorAspDotNetDev24-Feb-10 22:34 
GeneralRe: Read & Display a huge text file in textbox Pin
Som Shekhar24-Feb-10 22:36
Som Shekhar24-Feb-10 22:36 
GeneralRe: Read & Display a huge text file in textbox Pin
Luc Pattyn25-Feb-10 2:26
sitebuilderLuc Pattyn25-Feb-10 2:26 
QuestionHow to connect a existent instance through Component Object Model (COM) interface. Pin
Daniel_Teng24-Feb-10 16:11
Daniel_Teng24-Feb-10 16:11 
AnswerRe: How to connect a existent instance through Component Object Model (COM) interface. Pin
Dave Kreskowiak25-Feb-10 3:53
mveDave Kreskowiak25-Feb-10 3:53 
GeneralRe: How to connect a existent instance through Component Object Model (COM) interface. Pin
Daniel_Teng25-Feb-10 13:23
Daniel_Teng25-Feb-10 13:23 
GeneralRe: How to connect a existent instance through Component Object Model (COM) interface. Pin
Dave Kreskowiak25-Feb-10 13:56
mveDave Kreskowiak25-Feb-10 13:56 
QuestionExcel to SQL Pin
MAW3024-Feb-10 14:09
MAW3024-Feb-10 14:09 
I received the following error (see line *********error***********) when trying to transfer data from excel to sql using the code below. The sql table is in the database and columns all match the store procedure, does anyone have any idea what creates this problem.

Thanks in advance, Michael


Failed to obtain column collation information for the destination table. If the table is not in the current database the name must be qualified using the database name (e.g. [mydb]..[mytable](e.g. [mydb]..[mytable]); this also applies to temporary-tables (e.g. #mytable would be specified as tempdb..#mytable).

void ExcelToSqlBulkCopy(String strPath, String strFile, String strTableName)
{
strExcelStoredProcedure = "SELECT ID,City,State FROM [Cities$]";
String excelConnectionString = y;
String sqlConnectionString = z;

// Create Connection to Excel Workbook
using (OleDbConnection connection = new OleDbConnection(excelConnectionString))
{
OleDbCommand command = new OleDbCommand(strExcelStoredProcedure, connection);
connection.Open();

// Create DbDataReader to Data Worksheet
using (DbDataReader dr = command.ExecuteReader())
{
// Bulk Copy to SQL Server
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(sqlConnectionString))
{
bulkCopy.DestinationTableName = "[MyDatabase].[dbo].[" + strTableName + "]";
bulkCopy.WriteToServer(dr); *********error***********
}
}
connection.Close();
}
}
AnswerRe: Excel to SQL Pin
Mycroft Holmes24-Feb-10 15:42
professionalMycroft Holmes24-Feb-10 15:42 
Question3D library/engine .net Pin
LimeMan24-Feb-10 14:04
LimeMan24-Feb-10 14:04 
AnswerRe: 3D library/engine .net Pin
AspDotNetDev24-Feb-10 14:37
protectorAspDotNetDev24-Feb-10 14:37 
GeneralRe: 3D library/engine .net Pin
LimeMan25-Feb-10 4:43
LimeMan25-Feb-10 4:43 
GeneralRe: 3D library/engine .net Pin
AspDotNetDev25-Feb-10 9:22
protectorAspDotNetDev25-Feb-10 9:22 
AnswerRe: 3D library/engine .net Pin
jimclack26-Feb-10 9:14
jimclack26-Feb-10 9:14 
GeneralRe: 3D library/engine .net Pin
LimeMan28-Feb-10 10:18
LimeMan28-Feb-10 10:18 
QuestionSQL database with C#? Pin
Iman Mohtashemi24-Feb-10 12:57
Iman Mohtashemi24-Feb-10 12:57 
AnswerRe: SQL database with C#? Pin
AspDotNetDev24-Feb-10 14:36
protectorAspDotNetDev24-Feb-10 14:36 
GeneralRe: SQL database with C#? Pin
Iman Mohtashemi24-Feb-10 15:39
Iman Mohtashemi24-Feb-10 15:39 
GeneralRe: SQL database with C#? Pin
AspDotNetDev24-Feb-10 16:56
protectorAspDotNetDev24-Feb-10 16:56 
QuestionPurpose of Clip member in Graphics Pin
baranils24-Feb-10 10:34
baranils24-Feb-10 10:34 
AnswerRe: Purpose of Clip member in Graphics Pin
Dr.Walt Fair, PE24-Feb-10 11:13
professionalDr.Walt Fair, PE24-Feb-10 11:13 
GeneralRe: Purpose of Clip member in Graphics Pin
baranils24-Feb-10 20:28
baranils24-Feb-10 20:28 
GeneralRe: Purpose of Clip member in Graphics Pin
RichardM124-Feb-10 20:38
RichardM124-Feb-10 20:38 
GeneralRe: Purpose of Clip member in Graphics Pin
baranils24-Feb-10 20:50
baranils24-Feb-10 20:50 
GeneralRe: Purpose of Clip member in Graphics Pin
Dr.Walt Fair, PE25-Feb-10 4:00
professionalDr.Walt Fair, PE25-Feb-10 4:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.