Click here to Skip to main content
16,009,156 members
Home / Discussions / C#
   

C#

 
AnswerRe: Issue with array and program taking so long to run Pin
Ben Fair24-Nov-08 10:49
Ben Fair24-Nov-08 10:49 
GeneralRe: Issue with array and program taking so long to run Pin
SilentCodingOne24-Nov-08 16:53
SilentCodingOne24-Nov-08 16:53 
QuestionEditing Database using ADO.NET Pin
Ain't me babe24-Nov-08 9:11
Ain't me babe24-Nov-08 9:11 
AnswerRe: Editing Database using ADO.NET Pin
Christian Graus24-Nov-08 9:24
protectorChristian Graus24-Nov-08 9:24 
QuestionSo your question is Pin
led mike24-Nov-08 9:26
led mike24-Nov-08 9:26 
AnswerRe: So your question is Pin
Ain't me babe24-Nov-08 9:55
Ain't me babe24-Nov-08 9:55 
GeneralRe: So your question is Pin
led mike24-Nov-08 10:01
led mike24-Nov-08 10:01 
Questionhow to import excel sheet to postgresql database Pin
Ranjt kumar24-Nov-08 8:53
Ranjt kumar24-Nov-08 8:53 
Hi all,
i have arequirement to import excel sheet to postgresql using C#.

i wrote a code:
try
{
connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + @"Data Source=" + txtfilename.Text + ";" + "Extended Properties=Excel 8.0;");

mycommand = new OleDbDataAdapter(@"select * from [Ranjit$]", connection);
mydataset = new DataSet();
mycommand.Fill(mydataset, "ExcelInfo");
try
{
dataGridView1.DataSource = mydataset.Tables["ExcelInfo"].DefaultView;
}
catch (Exception ex)
{
//System.Diagnostics.Debug.WriteLine(ex.GetBaseException().ToString());
//MessageBox.Show(ex.GetBaseException().ToString());
throw new Exception(ex.Message);

}
So mydataset is displaying data in datagridview. this is working fine

No i have to send data to postgresql database
For that i wrote code

NpgsqlConnection strconn = new NpgsqlConnection(@"server=localhost;user id=postgres;password=thinksoft10@;database=Test;SyncNotification=true ");
strconn.Open();
NpgsqlCommand cmd = new NpgsqlCommand("COPY \"Test\" FROM STDIN", strconn);
NpgsqlCopyIn cin = new NpgsqlCopyIn(cmd, strconn);
cin.start();

but this is copying files to the database.

So please tell me how to copy that information in the postgresql database.

in my application i am able to show the excel sheet data in datagrid.

but i am not aable to send the excel sheet data to postgresql Test database test table.

Any help is appreciated!!!

thanks in anticipation
Ranjit.balu
AnswerRe: how to import excel sheet to postgresql database Pin
Wendelius24-Nov-08 9:30
mentorWendelius24-Nov-08 9:30 
QuestionbindingNavigator button images Pin
pcjd6324-Nov-08 7:18
pcjd6324-Nov-08 7:18 
AnswerRe: bindingNavigator button images Pin
Giorgi Dalakishvili24-Nov-08 7:22
mentorGiorgi Dalakishvili24-Nov-08 7:22 
GeneralRe: bindingNavigator button images Pin
pcjd6325-Nov-08 2:05
pcjd6325-Nov-08 2:05 
QuestionHow can an AxWebBrowser notify it's host about changes on its controls Pin
kozu24-Nov-08 7:14
kozu24-Nov-08 7:14 
Questionsetup customer background color Pin
Pr@teek B@h!24-Nov-08 5:50
Pr@teek B@h!24-Nov-08 5:50 
AnswerRe: setup customer background color Pin
Giorgi Dalakishvili24-Nov-08 6:03
mentorGiorgi Dalakishvili24-Nov-08 6:03 
GeneralRe: setup customer background color Pin
Pr@teek B@h!24-Nov-08 7:12
Pr@teek B@h!24-Nov-08 7:12 
GeneralRe: setup customer background color Pin
Giorgi Dalakishvili24-Nov-08 7:21
mentorGiorgi Dalakishvili24-Nov-08 7:21 
QuestionHow to generate the application line when using XMLSerializer to generate an Excel 2003 XML file Pin
TxPomeroy24-Nov-08 5:47
TxPomeroy24-Nov-08 5:47 
AnswerRe: How to generate the application line when using XMLSerializer to generate an Excel 2003 XML file Pin
leppie24-Nov-08 19:55
leppie24-Nov-08 19:55 
QuestionCombo box updates - but in 2 clicks Pin
spd6924-Nov-08 5:44
spd6924-Nov-08 5:44 
AnswerRe: Combo box updates - but in 2 clicks Pin
spd6924-Nov-08 13:57
spd6924-Nov-08 13:57 
QuestionDouble Post I know, Threading Question yet again Pin
EliottA24-Nov-08 5:40
EliottA24-Nov-08 5:40 
AnswerRe: Double Post I know, Threading Question yet again Pin
Giorgi Dalakishvili24-Nov-08 5:46
mentorGiorgi Dalakishvili24-Nov-08 5:46 
AnswerRe: Double Post I know, Threading Question yet again Pin
Russell Jones24-Nov-08 6:24
Russell Jones24-Nov-08 6:24 
Questionthe problem related to the position of tab button Pin
Seraph_summer24-Nov-08 5:17
Seraph_summer24-Nov-08 5:17 

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.