Click here to Skip to main content
15,889,808 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can't remove the last row from datagridview Pin
NewToAspDotNet4-Sep-08 23:43
NewToAspDotNet4-Sep-08 23:43 
Questioni donot understand listview Pin
netJP12L4-Sep-08 11:17
netJP12L4-Sep-08 11:17 
AnswerRe: i donot understand listview Pin
Wendelius4-Sep-08 11:33
mentorWendelius4-Sep-08 11:33 
AnswerRe: i donot understand listview Pin
Daniel Grunwald4-Sep-08 12:42
Daniel Grunwald4-Sep-08 12:42 
QuestionVisual Studio 2008 Installation error Pin
arkiboys4-Sep-08 9:58
arkiboys4-Sep-08 9:58 
RantRe: Visual Studio 2008 Installation error Pin
Mbah Dhaim4-Sep-08 10:02
Mbah Dhaim4-Sep-08 10:02 
AnswerRe: Visual Studio 2008 Installation error Pin
#realJSOP4-Sep-08 10:31
mve#realJSOP4-Sep-08 10:31 
QuestionFormat of the initialization string does not conform to specification starting at index 0.???? Pin
Twyce4-Sep-08 8:08
Twyce4-Sep-08 8:08 
I'm trying to export data from my Sql server database to an excel spreadsheet using bulkCopy.The problem is that whenever i run my application throws "Format of the initialization string does not conform to specification starting at index 0" error.Whatam i doing wrong? Here is my code

public class CopyData
{
string _sourceConnectionString = "Data Source= sict-sql;Initial Catalog=PSAtechZ;Integrated Security=True;";
string _destinationConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "E:\\+PSATECHZ EYES ONLY+\\PSAtechZTimetableSystem\\Students.xls" + "; Extended Properties='Excel 12.0; IMEX=1; HDR=YES'";

public CopyData(string sourceConnectionString, string destinationConnectionString)
{
_sourceConnectionString = sourceConnectionString;
_destinationConnectionString = destinationConnectionString;
}

public void CopyTable(string StudentModule)
{
using (SqlConnection source = new SqlConnection(_sourceConnectionString))
{
string sql = string.Format("SELECT * FROM [{0}]", StudentModule);

SqlCommand command = new SqlCommand(sql, source);

source.Open();
SqlDataReader dr = command.ExecuteReader();
//IDataReader dr = command.ExecuteReader();

using (SqlBulkCopy copy = new SqlBulkCopy(_destinationConnectionString))
{
copy.DestinationTableName = StudentModule;
copy.WriteToServer(dr);
}
}
}
}
i call this class under button export
AnswerRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
leppie4-Sep-08 8:59
leppie4-Sep-08 8:59 
AnswerRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Wendelius4-Sep-08 9:16
mentorWendelius4-Sep-08 9:16 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Twyce4-Sep-08 9:35
Twyce4-Sep-08 9:35 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Twyce4-Sep-08 9:42
Twyce4-Sep-08 9:42 
AnswerRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Pete O'Hanlon4-Sep-08 9:46
mvePete O'Hanlon4-Sep-08 9:46 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Twyce4-Sep-08 9:50
Twyce4-Sep-08 9:50 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Pete O'Hanlon4-Sep-08 9:55
mvePete O'Hanlon4-Sep-08 9:55 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Twyce4-Sep-08 10:51
Twyce4-Sep-08 10:51 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Pete O'Hanlon4-Sep-08 11:01
mvePete O'Hanlon4-Sep-08 11:01 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Twyce4-Sep-08 11:42
Twyce4-Sep-08 11:42 
GeneralRe: Format of the initialization string does not conform to specification starting at index 0.???? Pin
Wendelius6-Sep-08 9:18
mentorWendelius6-Sep-08 9:18 
Questionusing Task Scheduler 2.0 with XP Home Edition no password Pin
Member 23173964-Sep-08 7:42
Member 23173964-Sep-08 7:42 
Question[Solved]Have two forms open at the same time Pin
Jordanwb4-Sep-08 7:14
Jordanwb4-Sep-08 7:14 
AnswerRe: Have two forms open at the same time Pin
Aslesh4-Sep-08 7:39
Aslesh4-Sep-08 7:39 
GeneralRe: Have two forms open at the same time Pin
Jordanwb4-Sep-08 12:02
Jordanwb4-Sep-08 12:02 
AnswerRe: [Solved]Have two forms open at the same time Pin
nelsonpaixao4-Sep-08 13:43
nelsonpaixao4-Sep-08 13:43 
QuestionFile Listener instead BizTalk Orchestration Pin
Member 22295194-Sep-08 7:06
Member 22295194-Sep-08 7:06 

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.